mapbox / mapbox-gl-native

Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
https://mapbox.com/mobile
Other
4.38k stars 1.32k forks source link

No implementation found for void com.mapbox.mapboxsdk.net.NativeConnectivityListener.initialize() #15331

Closed hrach closed 5 years ago

hrach commented 5 years ago

Hi, this is obviously a reintroduction of of #14428, #11390, #13045 and maybe else. After releasing our app with updated Mapbox to:

    implementation "com.mapbox.mapboxsdk:mapbox-android-sdk:8.2.1"
    implementation "com.mapbox.mapboxsdk:mapbox-android-navigation:0.41.0"
    implementation "com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.41.0"

We got a spike with this crash:

Fatal Exception: 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__)
com.mapbox.mapboxsdk.net.NativeConnectivityListener.initialize (NativeConnectivityListener.java)
com.mapbox.mapboxsdk.net.NativeConnectivityListener. (NativeConnectivityListener.java:4)
com.mapbox.mapboxsdk.net.ConnectivityReceiver.instance (ConnectivityReceiver.java:43)
com.mapbox.mapboxsdk.Mapbox.getInstance (Mapbox.java:60)

mapbox_crash

Could it be caused by mismatch version where 8.2.1 is requested in unrelesed 0.42.0 (as suggested in #14428)?

Configuration

Android versions: 5-9 Device models: various Mapbox SDK versions: included above

LukasPaczos commented 5 years ago

What was the previous version of the SDK that you've used? We've recently changed the native library loader from ReLinker to the SoLoader in https://github.com/mapbox/mapbox-gl-native/pull/14890.

hrach commented 5 years ago

Previous versions were

    implementation "com.mapbox.mapboxsdk:mapbox-android-sdk:7.4.0"
    implementation "com.mapbox.mapboxsdk:mapbox-android-navigation:0.38.0"
    implementation "com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.38.0"
LukasPaczos commented 5 years ago

The SoLoader has been introduced in v8.0.1, so it does seem to be caused by that.

We're currently not planning to revert this change, but If you feel like you've had better results loading native code using ReLinker (or you want to try any other library), you can overwrite the default:

LibraryLoader.setLibraryLoader(new LibraryLoader() {
  @Override
  public void load(String name) {
    // load the library with the provided name
  }
});

This should be done before any code accesses SDK classes (Mapbox.java, layout inflation with MapView etc.).

I'm going to close as not actionable from the Maps SDK perspective.

ben-j69 commented 5 years ago

@LukasPaczos this is not a good answer. We are several people who have difficulties with the sdk and firing this error in production.

My error still occur in production and I need a fix :

Fatal Exception: 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__)

This error is fired by my application class

` @Override public void onCreate() { super.onCreate();

    mContext = this.getBaseContext();

    Mapbox.getInstance(mContext, getString(R.string.mapbox_api_key));`
Ruyven commented 5 years ago

Same problem here! How do I prevent soloader from crashing my app?

haroonkhan9426 commented 5 years ago

Having the same problem in production mode? Anyone found any solution?

haroonkhan9426 commented 5 years ago

@hrach @Ruyven did you found any workaround for this issue.

hrach commented 5 years ago

Well, I have realized that the majority of crashes are caused by custom installation of our app (read as cracked), e.g. this is because they do not installed all the needed apks since we use AAB ...

hrach commented 5 years ago

Actually, we had the same problem during Google Play feature verification process, the guys at Google used some apk (do not know which) and after telling them to use version from PlayStore everything was good.

haroonkhan9426 commented 5 years ago

@hrach I generate .aab file which when I test on Firebase testlab, it fails on around 4 to 6 devices out of 15. Due to which in crashes I'm not releasing the .aab on playstore. Do this issue has any link with .aab?

ben-j69 commented 4 years ago

I have the same problem on circle ci with this configuration :

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'
caovanthanh203 commented 4 years ago

This issue is duplicate and I solved it in #14428

lxzh commented 1 year ago

Occasionally, the so is not loaded properly, causing initialization failure

12-15 17:41:10.547   827   827 D SoLoader: init start
12-15 17:41:10.547   827   827 D SoLoader: adding system library source: /vendor/lib
12-15 17:41:10.548   827   827 D SoLoader: adding system library source: /system/lib
12-15 17:41:10.548   827   827 D SoLoader: adding backup source from : i.f.a.b[root = /data/data/com.xxx.xxx/lib-main flags = 1]
12-15 17:41:10.548   827   827 D SoLoader: Preparing SO source: i.f.a.d[root = /system/lib flags = 2]
12-15 17:41:10.548   827   827 D SoLoader: Preparing SO source: i.f.a.d[root = /system/vendor/lib flags = 2]
12-15 17:41:10.548   827   827 D SoLoader: Preparing SO source: i.f.a.b[root = /data/data/com.xxx.xxx/lib-main flags = 1]
12-15 17:41:10.550   827   827 D SoLoader: init exiting
12-15 17:41:10.585   827   827 E art     : No implementation found for void com.mapbox.mapboxsdk.maps.renderer.MapRenderer.nativeInitialize(com.mapbox.mapboxsdk.maps.renderer.MapRenderer, float, java.lang.String) (tried Java_com_mapbox_mapboxsdk_maps_renderer_MapRenderer_nativeInitialize and Java_com_mapbox_mapboxsdk_maps_renderer_MapRenderer_nativeInitialize__Lcom_mapbox_mapboxsdk_maps_renderer_MapRenderer_2FLjava_lang_String_2)
12-15 17:41:10.586   827   827 D AndroidRuntime: Shutting down VM
12-15 17:41:10.586   827   827 E DEBUG   : encryptLog: false, zipCrashLog: false

mapbox version:

    implementation('com.mapbox.mapboxsdk:mapbox-android-sdk:8.6.6')
    implementation('com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v8:0.7.0')
    implementation('com.mapbox.mapboxsdk:mapbox-android-plugin-localization-v8:0.11.0')
    implementation('com.mapbox.mapboxsdk:mapbox-android-plugin-markerview-v8:0.3.0')
    implementation('com.mapbox.mapboxsdk:mapbox-android-plugin-offline-v8:0.6.0')