React-native-mapbox-gl: Android app crashing after setAccessToken

Created on 13 May 2018  路  11Comments  路  Source: nitaliano/react-native-mapbox-gl

Hello,
I installed the library following the steps and could only get the app to run on Android after downgrading to 6.0.0. When I try to upgrade to 6.03 or the latest version. The app crashes after calling setAccessToken. Im testing on an Pixel 2 Xl and there are no logs or anything else to debug from.

Most helpful comment

The fix may most likely be found here:

https://github.com/mapbox/react-native-mapbox-gl/issues/1139#issuecomment-379647942

@nitaliano This issue should go away when we upgrade the native android mapbox library.

All 11 comments

What is your logcat saying? I'm running the latest version fine on a Pixel and Pixel 2

Thats the last thing that prints before setAccessToken is called. It is also crashing on my nexus 5x, but is running on IOS simulator.
mapbox

@nitaliano Do you have any suggestions?

I have the same issue here when testing with latest mapbox with RN 0.56 on android 8.0
executing react-native run-android to test on phone will crash when setAccessToken is called

07-12 00:38:30.505 1126 9525 W WindowManager: Exception thrown when updateSurfaceStatusWindowStateAnimator{2edaaff com.testapp/com.testapp.MainActivity}: android.os.DeadObjectException

I have the same issue too

This is the output when I i get when I call MapboxGL.setAccessToken(conf['mapboxAccessToken']); of course method is not defined, I know it because I checked in inside the source code.

    MapboxTelemetry  V  Initializing telemetry.
     AndroidRuntime  D  Shutting down VM
                     E  FATAL EXCEPTION: main
                     E  Process: com.yovoytaxi.passengerapp, PID: 21756
                     E  java.lang.NoSuchMethodError: No static method toHumanReadableAscii(Ljava/lang/String;)Ljava/lang/String; in class Lokhttp3/internal/Util; or its super classes (declaration of 'okh
                        ttp3.internal.Util' appears in /data/app/com.yovoytaxi.passengerapp-WxUpnZIgAkg9XhgzmiKWiQ==/base.apk)
                     E      at com.mapbox.services.android.telemetry.MapboxTelemetry.setUserAgent(MapboxTelemetry.java:315)
                     E      at com.mapbox.services.android.telemetry.MapboxTelemetry.initialize(MapboxTelemetry.java:174)
                     E      at com.mapbox.services.android.telemetry.MapboxTelemetry.initialize(MapboxTelemetry.java:125)
                     E      at com.mapbox.mapboxsdk.Mapbox.getInstance(Mapbox.java:60)
                     E      at com.mapbox.rctmgl.modules.RCTMGLModule$1.run(RCTMGLModule.java:279)
                     E      at android.os.Handler.handleCallback(Handler.java:790)
                     E      at android.os.Handler.dispatchMessage(Handler.java:99)
                     E      at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
                     E      at android.os.Looper.loop(Looper.java:164)
                     E      at android.app.ActivityThread.main(ActivityThread.java:6494)
                     E      at java.lang.reflect.Method.invoke(Native Method)
                     E      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
                     E      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
             zygote  E  Failed sending reply to debugger: Broken pipe

I can confirm I also get the same issue on ReactNative 0.56 when using Android 8

The same problem on device Mi A1 - 8.0.0

The fix may most likely be found here:

https://github.com/mapbox/react-native-mapbox-gl/issues/1139#issuecomment-379647942

@nitaliano This issue should go away when we upgrade the native android mapbox library.

@kristfal It helped!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alexisohayon picture alexisohayon  路  4Comments

Craytor picture Craytor  路  3Comments

Gp2mv3 picture Gp2mv3  路  3Comments

vyankat70war picture vyankat70war  路  3Comments

Maxence-Machu picture Maxence-Machu  路  3Comments