mapbox-gl-native icon indicating copy to clipboard operation
mapbox-gl-native copied to clipboard

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

Open hrach opened this issue 7 years ago • 13 comments

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

hrach avatar Aug 07 '19 15:08 hrach

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.

LukasPaczos avatar Aug 07 '19 15:08 LukasPaczos

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"

hrach avatar Aug 07 '19 16:08 hrach

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.

LukasPaczos avatar Aug 08 '19 09:08 LukasPaczos

@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));`

ben-j69 avatar Sep 18 '19 12:09 ben-j69

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

Ruyven avatar Oct 02 '19 21:10 Ruyven

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

haroonkhan9426 avatar Oct 08 '19 06:10 haroonkhan9426

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

haroonkhan9426 avatar Oct 09 '19 05:10 haroonkhan9426

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 avatar Oct 09 '19 06:10 hrach

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.

hrach avatar Oct 09 '19 06:10 hrach

@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?

haroonkhan9426 avatar Oct 09 '19 06:10 haroonkhan9426

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'

ben-j69 avatar Feb 03 '20 07:02 ben-j69

This issue is duplicate and I solved it in #14428

caovanthanh203 avatar Feb 13 '20 17:02 caovanthanh203

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')

lxzh avatar Dec 16 '22 06:12 lxzh