React-native-maps: Android app crashing on loading Polylines

Created on 13 Feb 2019  路  1Comment  路  Source: react-native-maps/react-native-maps

Is this a bug report?

No

Have you read the Installation Instructions?

Yes. I've tried to reinstall, but haven't success.

Environment

react-native: 0.57.5
react: 16.6.1
react-native-maps: 0.23.0
Target: Android

Steps to Reproduce

I'm trying to add Polyline to my MapView.

My MapView is working fine! Polygons are ok, but when I try to add Polyline my app crashes:

This is my code inside MapView:
<Polyline key="test" coordinates={[ { latitude: 37.8025259, longitude: -122.4351431 }, { latitude: 37.7896386, longitude: -122.421646 }, { latitude: 37.7665248, longitude: -122.4161628 }, { latitude: 37.7734153, longitude: -122.4577787 }, { latitude: 37.7948605, longitude: -122.4596065 }, { latitude: 37.8025259, longitude: -122.4351431 } ]} strokeWidth={1} />

Expected Behavior

Expected to show the static polylines above.

Actual Behavior

App crashes and when I debug in Android Studio, the follow debug result is presented:

--------- beginning of crash
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.monitoramentomobile, PID: 4076
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/maps/model/RoundCap;
at com.airbnb.android.react.maps.AirMapPolyline.(AirMapPolyline.java:27)
at com.airbnb.android.react.maps.AirMapPolylineManager.createViewInstance(AirMapPolylineManager.java:46)
at com.airbnb.android.react.maps.AirMapPolylineManager.createViewInstance(AirMapPolylineManager.java:24)
at com.facebook.react.uimanager.ViewManager.createView(ViewManager.java:42)
at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:260)
at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:200)
at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.dispatchPendingNonBatchedOperations(UIViewOperationQueue.java:1085)
at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:1056)
at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:29)
at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:134)
at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:105)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:933)
at android.view.Choreographer.doCallbacks(Choreographer.java:747)
at android.view.Choreographer.doFrame(Choreographer.java:679)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:921)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6649)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:826)
E/AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.maps.model.RoundCap" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.monitoramentomobile-eKjsguXBLnh4REjH50jkeA==/base.apk", zip file "/data/app/com.monitoramentomobile-eKjsguXBLnh4REjH50jkeA==/split_lib_dependencies_apk.apk", zip file "/data/app/com.monitoramentomobile-eKjsguXBLnh4REjH50jkeA==/split_lib_resources_apk.apk", zip file "/data/app/com.monitoramentomobile-eKjsguXBLnh4REjH50jkeA==/split_lib_slice_0_apk.apk", zip file "/data/app/com.monitoramentomobile-eKjsguXBLnh4REjH50jkeA==/split_lib_slice_1_apk.apk", zip file "/data/app/com.monitoramentomobile-eKjsguXBLnh4REjH50jkeA==/split_lib_slice_2_apk.apk", zip file "/data/app/com.monitoramentomobile-eKjsguXBLnh4REjH50jkeA==/split_lib_slice_3_apk.apk", zip file "/data/app/com.monitoramentomobile-eKjsguXBLnh4REjH50jkeA==/split_lib_slice_4_apk.apk", zip file "/data/app/com.monitoramentomobile-eKjsguXBLnh4REjH50jkeA==/split_lib_slice_5_apk.apk", zip file "/data/app/com.monitoramentomobile-eKjsguXBLnh4REjH50jkeA==/split_lib_slice_6_apk.apk", zip file "/data/app/com.monitoramentomobile-eKjsguXBLnh4REjH50jkeA==/split_lib_slice_7_apk.apk", zip file "/data/app/com.monitoramentomobile-eKjsguXBLnh4REjH50jkeA==/split_lib_slice_8_apk.apk", zip file "/data/app/com.monitoramentomobile-eKjsguXBLnh4REjH50jkeA==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.monitoramentomobile-eKjsguXBLnh4REjH50jkeA==/lib/x86, /data/app/com.monitoramentomobile-eKjsguXBLnh4REjH50jkeA==/base.apk!/lib/x86, /data/app/com.monitoramentomobile-eKjsguXBLnh4REjH50jkeA==/split_lib_dependencies_apk.apk!/lib/x86, /data/app/com.monitoramentomobile-eKjsguXBLnh4REjH50jkeA==/split_lib_resources_apk.apk!/lib/x86, /data/app/com.monitoramentomobile-eKjsguXBLnh4REjH50jkeA==/split_lib_slice_0_apk.apk!/lib/x86, /data/app/com.monitoramentomobile-eKjsguXBLnh4REjH50jkeA==/split_lib_slice_1_apk.apk!/lib/x86, /data/app/com.monitoramentomobile-eKjsguXBLnh4REjH50jkeA==/split_lib_slice_2_apk.apk!/lib/x86, /data/app/com.monitoramentomobile-eKjsguXBLnh4REjH50jkeA==/split_lib_slice_3_apk.apk!/lib/x86, /data/app/com.monitoramentomobile-eKjsguXBLnh4REjH50jkeA==/split_lib_slice_4_apk.apk!/lib/x86, /data/app/com.monitoramentomobile-eKjsguXBLnh4REjH50jkeA==/split_lib_slice_5_apk.apk!/lib/x86, /data/app/com.monitoramentomobile-eKjsguXBLnh4REjH50jkeA==/split_lib_slice_6_apk.apk!/lib/x86, /data/app/com.monitoramentomobile-eKjsguXBLnh4REjH50jkeA==/split_lib_slice_7_apk.apk!/lib/x86, /data/app/com.monitoramentomobile-eKjsguXBLnh4REjH50jkeA==/split_lib_slice_8_apk.apk!/lib/x86, /data/app/com.monitoramentomobile-eKjsguXBLnh4REjH50jkeA==/split_lib_slice_9_apk.apk!/lib/x86, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 22 more
Suppressed: java.io.IOException: No original dex files found for dex location /data/app/com.monitoramentomobile-eKjsguXBLnh4REjH50jkeA==/split_lib_resources_apk.apk
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:354)
at dalvik.system.DexFile.(DexFile.java:101)
at dalvik.system.DexFile.(DexFile.java:75)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:374)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:337)
at dalvik.system.DexPathList.(DexPathList.java:157)
at dalvik.system.BaseDexClassLoader.(BaseDexClassLoader.java:65)
at dalvik.system.PathClassLoader.(PathClassLoader.java:64)
at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:73)
at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:88)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:72)
E/AndroidRuntime: at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:38)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:715)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:750)
at android.app.LoadedApk.getResources(LoadedApk.java:972)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2329)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5743)
at android.app.ActivityThread.access$1000(ActivityThread.java:198)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1637)
at android.os.Handler.dispatchMessage(Handler.java:106)

Most helpful comment

To solve it, I just used the recommended project-wide properties:
ext { compileSdkVersion = 26 targetSdkVersion = 26 buildToolsVersion = "26.0.2" supportLibVersion = "26.1.0" googlePlayServicesVersion = "11.8.0" androidMapsUtilsVersion = "0.5+" }
Instead of:
dependencies { ... implementation(project(':react-native-maps')){ exclude group: 'com.google.android.gms', module: 'play-services-base' exclude group: 'com.google.android.gms', module: 'play-services-maps' } implementation 'com.google.android.gms:play-services-base:10.0.1' implementation 'com.google.android.gms:play-services-maps:10.0.1' }

>All comments

To solve it, I just used the recommended project-wide properties:
ext { compileSdkVersion = 26 targetSdkVersion = 26 buildToolsVersion = "26.0.2" supportLibVersion = "26.1.0" googlePlayServicesVersion = "11.8.0" androidMapsUtilsVersion = "0.5+" }
Instead of:
dependencies { ... implementation(project(':react-native-maps')){ exclude group: 'com.google.android.gms', module: 'play-services-base' exclude group: 'com.google.android.gms', module: 'play-services-maps' } implementation 'com.google.android.gms:play-services-base:10.0.1' implementation 'com.google.android.gms:play-services-maps:10.0.1' }

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iiitmahesh picture iiitmahesh  路  3Comments

iSimar picture iSimar  路  3Comments

MatheusGit picture MatheusGit  路  3Comments

divye01 picture divye01  路  3Comments

wnqnguo picture wnqnguo  路  3Comments