arcao / Geocaching4Locus

A Locus simple add-on allows you to download and import caches directly from Geocaching.com si­te.
http://geocaching4locus.eu/
GNU General Public License v3.0
20 stars 8 forks source link

IllegalArgumentException when starting SearchNearestActivity #89

Closed menion closed 7 years ago

menion commented 7 years ago

For unknown reason, since today, SearchNearestActivity started to crash. Update to latest (today 2. 8. 2017) version, restart of device, re-install, clear data, using without login ... does not help.

Crash log:

Process: com.arcao.geocaching4locus, PID: 11317
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.arcao.geocaching4locus/com.arcao.geocaching4locus.SearchNearestActivity}: java.lang.IllegalArgumentException: invalid qualifier: 14 RC
   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2947)
   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3008)
   at android.app.ActivityThread.-wrap14(ActivityThread.java)
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
   at android.os.Handler.dispatchMessage(Handler.java:102)
   at android.os.Looper.loop(Looper.java:154)
   at android.app.ActivityThread.main(ActivityThread.java:6688)
   at java.lang.reflect.Method.invoke(Native Method)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)

Caused by: java.lang.IllegalArgumentException: invalid qualifier: 14 RC
   at org.osgi.framework.Version.validate(SourceFile:190)
   at org.osgi.framework.Version.<init>(SourceFile:157)
   at org.osgi.framework.Version.parseVersion(SourceFile:220)
   at com.arcao.geocaching4locus.util.LocusTesting.isLocusInstalled(SourceFile:17)
   at com.arcao.geocaching4locus.SearchNearestActivity.onCreate(SourceFile:97)
   at android.app.Activity.performCreate(Activity.java:6912)
   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126)
   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2900)
   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3008) 
   at android.app.ActivityThread.-wrap14(ActivityThread.java) 
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650) 
   at android.os.Handler.dispatchMessage(Handler.java:102) 
   at android.os.Looper.loop(Looper.java:154) 
   at android.app.ActivityThread.main(ActivityThread.java:6688) 
   at java.lang.reflect.Method.invoke(Native Method) 
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468) 
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358) 

Click on "Import GC" ends with same issue ( just with ImportFromGCActivity activity ). Start from Locus Map app or from list of installed apps make no difference.

I tried all I had in mind, but no change. Also no update or something like this happen on my device and I'm sure it worked three days ago. Any idea? I tried to find something on SO, but no success ... mystery.

arcao commented 7 years ago

It looks like the OSGi Version class, which I use for version comparation, doesn't like Locus Map version qualifier part.

menion commented 7 years ago

Cannot say I understand :). Is there something I may do/help? Interesting that is started few days ago without any obvious reason. Same issue with latest public Locus Map version, so it looks like mobile dependent, not Locus Map dependent.

arcao commented 7 years ago

In add-on is built-in check for required Locus Map version and it seems the version returned with LocusUtils.getActiveVersion(context).getVersionName() is not valid for that version check code (I suspect the space between 14 and RC). Could you please tell me the complete version name to I could check it?

Thanks!

menion commented 7 years ago

Aaa here is a problem. It is correct, I just today published new Beta version that has name "3.24.14 RC". It is probably first time I named it like this for public version.

Have to say that check based on name is quite bad behavior. Naming may be "whatever". I always use same naming system, anyway for some private versions and also rarely for testing version, I add something "extra" to these names.

Now leave it be, but to future I really suggest to check available Locus based on LocusUtils.getActiveVersion(context).getVersionCode() value that is consistent and just increase by 1 with every version (beta, public). Thanks for answer!

arcao commented 7 years ago

I've published a new version 2.1.5.3 to Google Play, where this should be fixed. The versionCode is now used for minimal Locus Map version checking.

menion commented 7 years ago

Perfect thank You. I wanted to publish today new Beta version because of this, so it is not needed anymore.