naderio / nativescript-google-maps-utils

NativeScript Google Maps SDK utility library to support features such as marker clustering, heatmap, ...
The Unlicense
33 stars 15 forks source link

JNI error - not able to run demo app #18

Open felixkrautschuk opened 4 years ago

felixkrautschuk commented 4 years ago

Even though this repo seems not to be deprecated, I'm trying to get help on this issue here..

I took the demo app from this repo, migrated the project using tns migrate to NS 6 and updated the dependencies using tns update.

When the demo app is calling GoogleMapsUtils.setupMarkerCluster(mapView, markerSet, {});, the app crashes with a JNI error:

System.err: An uncaught Exception occurred on "main" thread. System.err: Calling js method onMapReady failed System.err: Error: JNI Exception occurred (SIGABRT). System.err: ======= System.err: Check the 'adb logcat' for additional information about the error. System.err: ======= System.err: System.err: System.err: StackTrace: System.err: (file: node_modules/nativescript-google-maps-utils/index.android.js:105:0) System.err: at setupMarkerCluster(file: node_modules/nativescript-google-maps-utils/index.android.js:102:0) System.err: at onMapReady(file: app/main-page.js:128:0) System.err: at push.../node_modules/@nativescript/core/data/observable/observable.js.Observable.notify(file: node_modules/@nativescript/core/data/observable/observable.js:110:0) System.err: at push.../node_modules/nativescript-google-maps-sdk/map-view-common.js.MapViewBase.notifyMapReady(file: node_modules/nativescript-google-maps-sdk/map-view-common.js:232:0) System.err: at onMapReady(file: node_modules/nativescript-google-maps-sdk/map-view.android.js:271:0) System.err: at com.tns.Runtime.callJSMethodNative(Native Method) System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1286) System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:1173) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1160) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1138) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1134) System.err: at com.tns.gen.com.google.android.gms.maps.OnMapReadyCallback.onMapReady(OnMapReadyCallback.java:19) System.err: at com.google.android.gms.maps.zzac.zza(Unknown Source:2) System.err: at com.google.android.gms.maps.internal.zzaq.dispatchTransaction(Unknown Source:12) System.err: at com.google.android.gms.internal.maps.zzb.onTransact(Unknown Source:12) System.err: at android.os.Binder.transact(Binder.java:914) System.err: at cg.b(:com.google.android.gms.dynamite_mapsdynamite@200616088@20.06.16 (120800-0):2) System.err: at com.google.maps.api.android.lib6.impl.be.run(:com.google.android.gms.dynamite_mapsdynamite@200616088@20.06.16 (120800-0):2) System.err: at android.os.Handler.handleCallback(Handler.java:883) System.err: at android.os.Handler.dispatchMessage(Handler.java:100) System.err: at android.os.Looper.loop(Looper.java:214) System.err: at android.app.ActivityThread.main(ActivityThread.java:7356) System.err: at java.lang.reflect.Method.invoke(Native Method) System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

When I run adb logcat, I get the following log:

03-10 11:41:36.237 19271 19271 F tivescript.dem: runtime.cc:638] JNI DETECTED ERROR IN APPLICATION: bad arguments passed to void com.google.maps.android.clustering.ClusterManager.addItem(com.google.maps.android.clustering.ClusterItem) (see above for details) 03-10 11:41:36.237 19271 19271 F tivescript.dem: runtime.cc:638] from java.lang.Object com.tns.Runtime.callJSMethodNative(int, int, java.lang.String, int, boolean, java.lang.Object[]) 03-10 11:41:36.237 19271 19271 F tivescript.dem: runtime.cc:638] 03-10 11:41:36.239 19271 19271 D AndroidRuntime: Shutting down VM 03-10 11:41:36.240 19271 19271 E AndroidRuntime: FATAL EXCEPTION: main 03-10 11:41:36.240 19271 19271 E AndroidRuntime: Process: org.nativescript.demo, PID: 19271 03-10 11:41:36.240 19271 19271 E AndroidRuntime: com.tns.NativeScriptException: Calling js method onMapReady failed 03-10 11:41:36.240 19271 19271 E AndroidRuntime: Error: JNI Exception occurred (SIGABRT). 03-10 11:41:36.240 19271 19271 E AndroidRuntime: ======= 03-10 11:41:36.240 19271 19271 E AndroidRuntime: Check the 'adb logcat' for additional information about the error. 03-10 11:41:36.240 19271 19271 E AndroidRuntime: ======= 03-10 11:41:36.240 19271 19271 E AndroidRuntime: 03-10 11:41:36.240 19271 19271 E AndroidRuntime: at com.tns.Runtime.callJSMethodNative(Native Method) 03-10 11:41:36.240 19271 19271 E AndroidRuntime: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1286) 03-10 11:41:36.240 19271 19271 E AndroidRuntime: at com.tns.Runtime.callJSMethodImpl(Runtime.java:1173) 03-10 11:41:36.240 19271 19271 E AndroidRuntime: at com.tns.Runtime.callJSMethod(Runtime.java:1160) 03-10 11:41:36.240 19271 19271 E AndroidRuntime: at com.tns.Runtime.callJSMethod(Runtime.java:1138) 03-10 11:41:36.240 19271 19271 E AndroidRuntime: at com.tns.Runtime.callJSMethod(Runtime.java:1134) 03-10 11:41:36.240 19271 19271 E AndroidRuntime: at com.tns.gen.com.google.android.gms.maps.OnMapReadyCallback.onMapReady(OnMapReadyCallback.java:19) 03-10 11:41:36.240 19271 19271 E AndroidRuntime: at com.google.android.gms.maps.zzac.zza(Unknown Source:2) 03-10 11:41:36.240 19271 19271 E AndroidRuntime: at com.google.android.gms.maps.internal.zzaq.dispatchTransaction(Unknown Source:12) 03-10 11:41:36.240 19271 19271 E AndroidRuntime: at com.google.android.gms.internal.maps.zzb.onTransact(Unknown Source:12) 03-10 11:41:36.240 19271 19271 E AndroidRuntime: at android.os.Binder.transact(Binder.java:914) 03-10 11:41:36.240 19271 19271 E AndroidRuntime: at cg.b(:com.google.android.gms.dynamite_mapsdynamite@200616088@20.06.16 (120800-0):2) 03-10 11:41:36.240 19271 19271 E AndroidRuntime: at com.google.maps.api.android.lib6.impl.be.run(:com.google.android.gms.dynamite_mapsdynamite@200616088@20.06.16 (120800-0):2) 03-10 11:41:36.240 19271 19271 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:883) 03-10 11:41:36.240 19271 19271 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:100) 03-10 11:41:36.240 19271 19271 E AndroidRuntime: at android.os.Looper.loop(Looper.java:214) 03-10 11:41:36.240 19271 19271 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7356) 03-10 11:41:36.240 19271 19271 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 03-10 11:41:36.240 19271 19271 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) 03-10 11:41:36.240 19271 19271 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) 03-10 11:41:36.242 19271 19271 W System.err: An uncaught Exception occurred on "main" thread. 03-10 11:41:36.242 19271 19271 W System.err: Calling js method onMapReady failed 03-10 11:41:36.242 19271 19271 W System.err: Error: JNI Exception occurred (SIGABRT). 03-10 11:41:36.242 19271 19271 W System.err: ======= 03-10 11:41:36.242 19271 19271 W System.err: Check the 'adb logcat' for additional information about the error. 03-10 11:41:36.242 19271 19271 W System.err: ======= 03-10 11:41:36.242 19271 19271 W System.err: 03-10 11:41:36.242 19271 19271 W System.err: 03-10 11:41:36.242 19271 19271 W System.err: StackTrace: 03-10 11:41:36.242 19271 19271 W System.err: (file:///data/data/org.nativescript.demo/files/app/vendor.js:54072:24) 03-10 11:41:36.242 19271 19271 W System.err: at setupMarkerCluster(file:///data/data/org.nativescript.demo/files/app/vendor.js:54069:13) 03-10 11:41:36.242 19271 19271 W System.err: at onMapReady(file:///data/data/org.nativescript.demo/files/app/bundle.js:350:19) 03-10 11:41:36.242 19271 19271 W System.err: at push.../node_modules/@nativescript/core/data/observable/observable.js.Observable.notify(file:///data/data/org.nativescript.demo/files/app/vendor.js:3779:23) 03-10 11:41:36.242 19271 19271 W System.err: at push.../node_modules/nativescript-google-maps-sdk/map-view-common.js.MapViewBase.notifyMapReady(file:///data/data/org.nativescript.demo/files/app/vendor.js:52299:14) 03-10 11:41:36.242 19271 19271 W System.err: at onMapReady(file:///data/data/org.nativescript.demo/files/app/vendor.js:52813:23) 03-10 11:41:36.242 19271 19271 W System.err: at com.tns.Runtime.callJSMethodNative(Native Method) 03-10 11:41:36.242 19271 19271 W System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1286) 03-10 11:41:36.242 19271 19271 W System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:1173) 03-10 11:41:36.242 19271 19271 W System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1160) 03-10 11:41:36.242 19271 19271 W System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1138) 03-10 11:41:36.242 19271 19271 W System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1134) 03-10 11:41:36.242 19271 19271 W System.err: at com.tns.gen.com.google.android.gms.maps.OnMapReadyCallback.onMapReady(OnMapReadyCallback.java:19) 03-10 11:41:36.242 19271 19271 W System.err: at com.google.android.gms.maps.zzac.zza(Unknown Source:2) 03-10 11:41:36.242 19271 19271 W System.err: at com.google.android.gms.maps.internal.zzaq.dispatchTransaction(Unknown Source:12) 03-10 11:41:36.243 19271 19271 W System.err: at com.google.android.gms.internal.maps.zzb.onTransact(Unknown Source:12) 03-10 11:41:36.243 19271 19271 W System.err: at android.os.Binder.transact(Binder.java:914) 03-10 11:41:36.243 19271 19271 W System.err: at cg.b(:com.google.android.gms.dynamite_mapsdynamite@200616088@20.06.16 (120800-0):2) 03-10 11:41:36.243 19271 19271 W System.err: at com.google.maps.api.android.lib6.impl.be.run(:com.google.android.gms.dynamite_mapsdynamite@200616088@20.06.16 (120800-0):2) 03-10 11:41:36.243 19271 19271 W System.err: at android.os.Handler.handleCallback(Handler.java:883) 03-10 11:41:36.243 19271 19271 W System.err: at android.os.Handler.dispatchMessage(Handler.java:100) 03-10 11:41:36.243 19271 19271 W System.err: at android.os.Looper.loop(Looper.java:214) 03-10 11:41:36.243 19271 19271 W System.err: at android.app.ActivityThread.main(ActivityThread.java:7356) 03-10 11:41:36.243 19271 19271 W System.err: at java.lang.reflect.Method.invoke(Native Method) 03-10 11:41:36.243 19271 19271 W System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) 03-10 11:41:36.243 19271 19271 W System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) 03-10 11:41:36.250 2039 2309 I ActivityTaskManager: START u0 {flg=0x14008000 cmp=org.nativescript.demo/com.tns.ErrorReportActivity (has extras)} from uid 10484 03-10 11:41:36.252 2039 2309 W InputReader: Device has associated, but no associated display id. 03-10 11:41:36.252 2039 2309 I chatty : uid=1000(system) Binder:2039_4 identical 8 lines 03-10 11:41:36.252 2039 2309 W InputReader: Device has associated, but no associated display id. 03-10 11:41:36.253 19271 19314 D NetworkSecurityConfig: No Network Security Config specified, using platform default 03-10 11:41:36.255 19271 19271 I Process : Sending signal. PID: 19271 SIG: 9

The strange thing is that I was able to use the clustering functionality in a nativescript app for a short time and then suddenly I get this JNI error and I have no idea what changes i made that could cause this usse. I even started from scratch in a seperate project and I am not able to call this setupMarkerCluster method anymore without crashing the app. I don't know why it has worked before then...

Is anyone having a similar problem?

@naderio just in case you are still working on this repo, here is the modified/updated demo app to reproduce this: demo.zip