apptentive / apptentive-android

Apptentive Android SDK
http://www.apptentive.com
BSD 3-Clause "New" or "Revised" License
65 stars 64 forks source link

E/Apptentive: java.lang.NumberFormatException #129

Closed GlebMaltsev closed 6 years ago

GlebMaltsev commented 7 years ago

When start my application, log cat show me stack trace: https://gist.github.com/GlebMaltsev/7e94f3fbc3210f19c84ebd5da5cb860c

This error not crash my app, but seems that it broke some logic in Apptentive. I use Apptentive v3.2.2.

I think the reason of it that you try to parse app version name as sequence of long separated numbers. For current stack trace i use versionName "0.1.4" in default config. BUT also i have versionNameSuffix "-DEBUG" for debug build type and versionNameSuffix "-QA" for qa flavor. Total version name returned by BuildConfig.VERSION_NAME when i assemble qa debug build is "0.1.4-QA-DEBUG".

skykelsey commented 7 years ago

Hello Gleb,

You are correct. We currently only allow "semantic versions" which are integers separated by dots. The evalution short circuits, so if your app is versioned 0.2.0, and you are trying to match 0.2.0 > 0.1.4-QA-DEBUG, that would work, since it would not bother evaluating the third part. I will see if there is a better way for us to handle your use-case though. Would you consider the correct behavior to be a simple string equality check if the part isn't a number?

Thanks! Sky

GlebMaltsev commented 7 years ago

Yes, thanks!