Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.0.9] Crashing on Android #626

Closed
systemlevel opened this issue Jan 18, 2020 · 12 comments
Closed

[7.0.9] Crashing on Android #626

systemlevel opened this issue Jan 18, 2020 · 12 comments

Comments

@systemlevel
Copy link
Contributor

Describe the bug
App no longer loads and crashes as the app is opening up.

To Reproduce
Upgrade to version 7.0.9. Open Andriod app.

Crash results from Android Debugger:

E/SoLibraryLoader: Couldn't load so file with relinker, application context missing, call Mapbox.getInstance(Context context, String accessToken) first
E/Mbgl-LibraryLoader: Failed to load native shared library.
    java.lang.UnsatisfiedLinkError: 
    Using MapView requires calling Mapbox.getInstance(Context context, String accessToken) before inflating or creating the view. The access token parameter is required when using a Mapbox service.
    Please see https://www.mapbox.com/help/create-api-access-token/ to learn how to create one.
    More information in this guide https://www.mapbox.com/help/first-steps-android-sdk/#access-tokens.
        at com.mapbox.mapboxsdk.module.loader.LibraryLoaderProviderImpl$SoLibraryLoader.load(LibraryLoaderProviderImpl.java:46)
        at com.mapbox.mapboxsdk.LibraryLoader.load(LibraryLoader.java:43)
        at com.mapbox.mapboxsdk.offline.OfflineManager.<clinit>(OfflineManager.java:45)
        at com.mapbox.mapboxsdk.offline.OfflineManager.getInstance(Unknown Source:0)
        at com.mapbox.rctmgl.modules.RCTMGLOfflineModule.setTileCountLimit(RCTMGLOfflineModule.java:324)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:371)
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:150)
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:26)
        at android.os.Looper.loop(Looper.java:193)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:225)
        at java.lang.Thread.run(Thread.java:764)

Does not happen with 7.0.8 or lower.

Expected behavior
App should load normally without crash.

Screenshots

Screen Shot 2020-01-18 at 11 01 23 AM

Versions (please complete the following information):

  • Platfrom: Android
  • Device: Android Simulator and Android Device (Moto)
  • OS: Android
  • SDK Version 28
  • React Native Version "react-native": "0.61.5",

Additional context

iOS seems to load and work with Mapbox 7.0.9.

@systemlevel
Copy link
Contributor Author

systemlevel commented Jan 18, 2020

Would any of the recent updates to the offline manager in 7.0.9 indicate a source of the issue in your opinion @tsemerad #588, @entranOA #566, @gmaclennan #508?

Thank you all for your contributions. I'm excited to try them out once I can get 7.0.9 working on Android.

@systemlevel
Copy link
Contributor Author

This is also popping up from the Android debug console:

E/com.sth: No implementation found for void com.mapbox.mapboxsdk.net.NativeConnectivityListener.initialize() (tried Java_com_mapbox_mapboxsdk_net_NativeConnectivityListener_initialize and Java_com_mapbox_mapboxsdk_net_NativeConnectivityListener_initialize__)
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.sth, PID: 9687
    java.lang.UnsatisfiedLinkError: No implementation found for void com.mapbox.mapboxsdk.net.NativeConnectivityListener.initialize() (tried Java_com_mapbox_mapboxsdk_net_NativeConnectivityListener_initialize and Java_com_mapbox_mapboxsdk_net_NativeConnectivityListener_initialize__)
        at com.mapbox.mapboxsdk.net.NativeConnectivityListener.initialize(Native Method)
        at com.mapbox.mapboxsdk.net.NativeConnectivityListener.<init>(NativeConnectivityListener.java:27)
        at com.mapbox.mapboxsdk.net.ConnectivityReceiver.instance(ConnectivityReceiver.java:43)
        at com.mapbox.mapboxsdk.Mapbox.getInstance(Mapbox.java:64)
        at com.mapbox.rctmgl.modules.RCTMGLModule$1.run(RCTMGLModule.java:292)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:26)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6669)
        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:858)

I'm using "react-native": "0.61.5" so the auto-linking should be working as it was included in 7.0.7?

@systemlevel
Copy link
Contributor Author

Thank you for PR bumping to 8.6.1 @ferdicus. I was hoping this would solve the issue for me as well but unfortunately I'm still getting issues that cause the app to crash.

I'm having a very challenging time trying to pinpoint what the exact issue is.

@systemlevel
Copy link
Contributor Author

For anyone else experiencing this here are some references to the native java android repo discussing this same issue:

mapbox/mapbox-gl-native#15331
mapbox/mapbox-gl-native#15535
mapbox/mapbox-gl-native#13045

From this repo:

https://github.com/react-native-mapbox-gl/maps/issues/353

I still don't have a fix to share yet.

@ferdicus
Copy link
Member

Hey there, thanks for also looking into this.
I think we might've multiple crash causing issues here unfortunately :(

@systemlevel systemlevel changed the title 7.0.9 Crashing on Android [7.0.9] Crashing on Android Jan 20, 2020
@ben-j69
Copy link

ben-j69 commented Feb 3, 2020

Same problem on circleci with this config 👍
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:8.6.2'
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-services:4.9.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.42.4'
implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.42.4'

@mfazekas
Copy link
Contributor

The master has now android 9.0.0

@mfazekas
Copy link
Contributor

I'm closing this. Please try and report with 8.0.0 if you have any issues.

@priyankverma
Copy link

Hey, I am using version "^8.0.0", but still the app is crashing with "The access token parameter is required when using Mapbox service."

@mfazekas
Copy link
Contributor

@priyankverma it's not related - you need to provide an access token before using mapbox.

https://github.com/react-native-mapbox-gl/maps/blob/master/docs/GettingStarted.md#setting-your-accesstoken

@priyankverma
Copy link

@mfazekas, thanks for the reply. But I want to use the Tiles from OSM, I am not making the use of mapbox styles, can you guide me in that way?

@mfazekas
Copy link
Contributor

@priyankverma pls submit a new issue with a simple script to reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants