[TIMOB-25289] Android: [ti.map] No static method getAppCurrentActivity()
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2017-09-15T11:55:27.000+0000 |
Affected Version/s | Release 6.2.0 |
Fix Version/s | n/a |
Components | Android |
Labels | n/a |
Reporter | Brian García |
Assignee | Unknown |
Created | 2017-09-14T15:02:23.000+0000 |
Updated | 2018-08-06T17:41:07.000+0000 |
Description
Trying to add an annotation or a circle (I suppose any view we can add to a mapView) throws the following error:
[WARN] : W/System.err: java.lang.NoSuchMethodError: No static method getAppCurrentActivity()Lorg/appcelerator/titanium/TiBaseActivity; in class Lorg/appcelerator/titanium/TiApplication; or its super classes (declaration of 'org.appcelerator.titanium.TiApplication' appears in /data/app/com.cccccc.xxxxxxxxx-2/base.apk)
[WARN] : W/System.err: at ti.map.CircleProxy.toPx(CircleProxy.java:61)
[WARN] : W/System.err: at ti.map.CircleProxy.processOptions(CircleProxy.java:157)
[WARN] : W/System.err: at ti.map.TiUIMapView.addCircle(TiUIMapView.java:670)
[WARN] : W/System.err: at ti.map.ViewProxy.handleAddCircle(ViewProxy.java:878)
[WARN] : W/System.err: at ti.map.ViewProxy.addCircle(ViewProxy.java:863)
[WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Object.nativeCallProperty(Native Method)
[WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Object.callProperty(V8Object.java:73)
[WARN] : W/System.err: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1158)
[WARN] : W/System.err: at android.os.Handler.dispatchMessage(Handler.java:98)
[WARN] : W/System.err: at android.os.Looper.loop(Looper.java:154)
[WARN] : W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6077)
[WARN] : W/System.err: at java.lang.reflect.Method.invoke(Native Method)
[WARN] : W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
[WARN] : W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
[ERROR] : TiExceptionHandler: (main) [683,29344] ----- Titanium Javascript Runtime Error -----
[ERROR] : TiExceptionHandler: (main) [0,29344] - In /alloy/controllers/scenarios/map.js:140,19
[ERROR] : TiExceptionHandler: (main) [0,29344] - Message: Uncaught No static method getAppCurrentActivity()Lorg/appcelerator/titanium/TiBaseActivity; in class Lorg/appcelerator/titanium/TiApplication; or its super classes (declaration of 'org.appcelerator.titanium.TiApplication' appears in /data/app/com.cccccc.xxxxxxxxx-2/base.apk)
[ERROR] : TiExceptionHandler: (main) [0,29344] - Source: $.mapView.addCircle(circle);
[ERROR] : V8Exception: Exception occurred at /alloy/controllers/scenarios/map.js:140: Uncaught No static method getAppCurrentActivity()Lorg/appcelerator/titanium/TiBaseActivity; in class Lorg/appcelerator/titanium/TiApplication; or its super classes (declaration of 'org.appcelerator.titanium.TiApplication' appears in /data/app/com.cccccc.xxxxxxxxx-2/base.apk)
[ERROR] : V8Exception: No static method getAppCurrentActivity()Lorg/appcelerator/titanium/TiBaseActivity; in class Lorg/appcelerator/titanium/TiApplication; or its super classes (declaration of 'org.appcelerator.titanium.TiApplication' appears in /data/app/com.cccccc.xxxxxxxxx-2/base.apk)
This should have been fixed by https://github.com/appcelerator/titanium_mobile/pull/9372, I'll investigate.
For a normal annotation this error is shown:
A workaround for that is to add a custom image because then it won't use https://github.com/appcelerator-modules/ti.map/blob/master/android/src/ti/map/AnnotationProxy.java#L343
Resolving as Duplicate of TIMOB-25288 - we are taking this into immediate resolution for SDK 6.2.1 and Ti.Map 3.3.1. Once the updated Ti.Map is available, you can use it already without waiting for 6.2.1. Please stay tuned a bit more!
Closing as a duplicate. If this is in error, please reopen.