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

java.lang.UnsatisfiedLinkError: ...libmapbox-gl.so has unexpected e_machine: 40 (EM_ARM) #248

Closed
mtin79 opened this issue Mar 27, 2020 · 12 comments

Comments

@mtin79
Copy link

mtin79 commented Mar 27, 2020

hi there,
I am using Mac OS X Catalina and when I try to run Mapbox-GL on an android emulator (virtual device, with android studio) I get the error printed below.

does anyone know what he issue could be? it runs well on iOS simulator and physical device.
thanks for any suggestion and help!

D/SoLoader( 5257): About to load: libc.so
D/SoLoader( 5257): libc.so not found on /data/data/com.example.webmap/lib-main
D/SoLoader( 5257): libc.so not found on /data/app/com.example.webmap-XkO2HAZpt81asEeeeVtujA==/lib/x86
D/SoLoader( 5257): libc.so not found on /vendor/lib
D/SoLoader( 5257): libc.so found on /system/lib
D/SoLoader( 5257): libc.so loaded implicitly
D/SoLoader( 5257): Loaded: libc.so
W/System.err( 5257): java.lang.UnsatisfiedLinkError: dlopen failed: "/data/data/com.example.webmap/lib-main/libmapbox-gl.so" has unexpected e_machine: 40 (EM_ARM)
W/System.err( 5257):    at java.lang.Runtime.load0(Runtime.java:928)
W/System.err( 5257):    at java.lang.System.load(System.java:1633)
W/System.err( 5257):    at com.facebook.soloader.SoLoader$1.load(SoLoader.java:393)
W/System.err( 5257):    at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:77)
W/System.err( 5257):    at com.facebook.soloader.UnpackingSoSource.loadLibrary(UnpackingSoSource.java:458)
W/System.err( 5257):    at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:731)
W/System.err( 5257):    at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:639)
W/System.err( 5257):    at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:577)
W/System.err( 5257):    at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:525)
W/System.err( 5257):    at com.mapbox.mapboxsdk.module.loader.LibraryLoaderProviderImpl$SoLibraryLoader.load(LibraryLoaderProviderImpl.java:42)
W/System.err( 5257):    at com.mapbox.mapboxsdk.LibraryLoader.load(LibraryLoader.java:43)
W/System.err( 5257):    at com.mapbox.mapboxsdk.net.NativeConnectivityListener.<clinit>(NativeConnectivityListener.java:13)
W/System.err( 5257):    at com.mapbox.mapboxsdk.net.ConnectivityReceiver.instance(ConnectivityReceiver.java:43)
W/System.err( 5257):    at com.mapbox.mapboxsdk.Mapbox.getInstance(Mapbox.java:67)
W/System.err( 5257):    at com.mapbox.mapboxgl.MapboxMapController.<init>(MapboxMapController.java:128)
W/System.err( 5257):    at com.mapbox.mapboxgl.MapboxMapBuilder.build(MapboxMapBuilder.java:33)
W/System.err( 5257):    at com.mapbox.mapboxgl.MapboxMapFactory.create(MapboxMapFactory.java:37)
W/System.err( 5257):    at io.flutter.plugin.platform.SingleViewPresentation.onCreate(SingleViewPresentation.java:176)
W/System.err( 5257):    at android.app.Dialog.dispatchOnCreate(Dialog.java:407)
W/System.err( 5257):    at android.app.Dialog.show(Dialog.java:302)
W/System.err( 5257):    at android.app.Presentation.show(Presentation.java:249)
W/System.err( 5257):    at io.flutter.plugin.platform.VirtualDisplayController.<init>(VirtualDisplayController.java:93)
W/System.err( 5257):    at io.flutter.plugin.platform.VirtualDisplayController.create(VirtualDisplayController.java:46)
W/System.err( 5257):    at io.flutter.plugin.platform.PlatformViewsController$1.createPlatformView(PlatformViewsController.java:112)
W/System.err( 5257):    at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:95)
W/System.err( 5257):    at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59)
W/System.err( 5257):    at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:226)
W/System.err( 5257):    at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
W/System.err( 5257):    at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:631)
W/System.err( 5257):    at android.os.MessageQueue.nativePollOnce(Native Method)
W/System.err( 5257):    at android.os.MessageQueue.next(MessageQueue.java:326)
W/System.err( 5257):    at android.os.Looper.loop(Looper.java:160)
W/System.err( 5257):    at android.app.ActivityThread.main(ActivityThread.java:6669)
W/System.err( 5257):    at java.lang.reflect.Method.invoke(Native Method)
W/System.err( 5257):    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
W/System.err( 5257):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
E/SoLoader( 5257): couldn't find DSO to load: libmapbox-gl.so caused by: dlopen failed: "/data/data/com.example.webmap/lib-main/libmapbox-gl.so" has unexpected e_machine: 40 (EM_ARM)
E/Mbgl-LibraryLoader( 5257): Failed to load native shared library.
E/Mbgl-LibraryLoader( 5257): com.facebook.soloader.SoLoader$WrongAbiError: APK was built for a different platform
E/Mbgl-LibraryLoader( 5257):    at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:645)
E/Mbgl-LibraryLoader( 5257):    at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:577)
E/Mbgl-LibraryLoader( 5257):    at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:525)
E/Mbgl-LibraryLoader( 5257):    at com.mapbox.mapboxsdk.module.loader.LibraryLoaderProviderImpl$SoLibraryLoader.load(LibraryLoaderProviderImpl.java:42)
E/Mbgl-LibraryLoader( 5257):    at com.mapbox.mapboxsdk.LibraryLoader.load(LibraryLoader.java:43)
E/Mbgl-LibraryLoader( 5257):    at com.mapbox.mapboxsdk.net.NativeConnectivityListener.<clinit>(NativeConnectivityListener.java:13)
E/Mbgl-LibraryLoader( 5257):    at com.mapbox.mapboxsdk.net.ConnectivityReceiver.instance(ConnectivityReceiver.java:43)
E/Mbgl-LibraryLoader( 5257):    at com.mapbox.mapboxsdk.Mapbox.getInstance(Mapbox.java:67)
E/Mbgl-LibraryLoader( 5257):    at com.mapbox.mapboxgl.MapboxMapController.<init>(MapboxMapController.java:128)
E/Mbgl-LibraryLoader( 5257):    at com.mapbox.mapboxgl.MapboxMapBuilder.build(MapboxMapBuilder.java:33)
E/Mbgl-LibraryLoader( 5257):    at com.mapbox.mapboxgl.MapboxMapFactory.create(MapboxMapFactory.java:37)
E/Mbgl-LibraryLoader( 5257):    at io.flutter.plugin.platform.SingleViewPresentation.onCreate(SingleViewPresentation.java:176)
E/Mbgl-LibraryLoader( 5257):    at android.app.Dialog.dispatchOnCreate(Dialog.java:407)
E/Mbgl-LibraryLoader( 5257):    at android.app.Dialog.show(Dialog.java:302)
E/Mbgl-LibraryLoader( 5257):    at android.app.Presentation.show(Presentation.java:249)
@mtin79 mtin79 changed the title flutter run -d <androidVirtualDevice> : java.lang.UnsatisfiedLinkError: dlopen failed: ...libmapbox-gl.so has unexpected e_machine: 40 (EM_ARM) flutter run -d <androidVirtualDevice> : java.lang.UnsatisfiedLinkError: ...libmapbox-gl.so has unexpected e_machine: 40 (EM_ARM) Mar 27, 2020
@m0nac0
Copy link
Collaborator

m0nac0 commented Mar 28, 2020

Hi, a similar issue has been described at #167 (although that issue thread is a bit of a mess, because multiple different issues are discussed)
What API level is your Android emulator on, if it is 28 could you try (temporarily) downgrading to 27?
Also, could you please try what I suggested at #167 (comment)?

@m0nac0 m0nac0 changed the title flutter run -d <androidVirtualDevice> : java.lang.UnsatisfiedLinkError: ...libmapbox-gl.so has unexpected e_machine: 40 (EM_ARM) java.lang.UnsatisfiedLinkError: ...libmapbox-gl.so has unexpected e_machine: 40 (EM_ARM) Mar 28, 2020
@m0nac0
Copy link
Collaborator

m0nac0 commented Mar 28, 2020

@raphaaugustosilva If you are still experiencing the same issue, I would suggest that you also comment over here. (Because #167 has become pretty confusing)

@m0nac0 m0nac0 removed the flutter label Mar 29, 2020
@Youssless
Copy link

I had the same issue, works with api 29 and below. Api R doesn't seem to work

@fotiDim
Copy link

fotiDim commented Apr 21, 2020

I am having the same issue with any emulator starting Android P and above. Android Oreo works OK.
What I also noticed is that the issue only occurs when doing flutter run. Building through Android Studio works fine on any version of Android.

@AAverin
Copy link
Contributor

AAverin commented Apr 28, 2020

Can confirm getting the issue on emulator API 28, built through Android Studio.
On the iOS emulator everything seems to work fine with the same build.
Will try to test today on real device and different other emulators, but I am pretty sure that about 2 months ago everything was working.

The version of mapbox_gl is still 0.0.5 and wasn't updated. Were there any changes published into the same version of the library?

@AAverin
Copy link
Contributor

AAverin commented Apr 28, 2020

API 21 emulator, same trace

@AAverin
Copy link
Contributor

AAverin commented Apr 28, 2020

Real device also crashes, so it's definitely not emulator issue

@AAverin
Copy link
Contributor

AAverin commented May 25, 2020

Should be resolved by mapbox/mapbox-gl-native-android#111 with update to 9.2.0

@m0nac0
Copy link
Collaborator

m0nac0 commented Jun 9, 2020

Closing this as it's likely fixed by #283, feel free to reopen if the issue persists.

@m0nac0 m0nac0 closed this as completed Jun 9, 2020
@AAverin
Copy link
Contributor

AAverin commented Aug 5, 2020

@m0nac0 I am using the library directly from master

mapbox_gl:
    git:
      url: git://github.com/tobrun/flutter-mapbox-gl.git

This issue seems to be back, at least on master. I will test on release, but probably worth checking

@m0nac0
Copy link
Collaborator

m0nac0 commented Aug 5, 2020

@AAverin Is your issue the same as mapbox/mapbox-gl-native-android#416?

@AAverin
Copy link
Contributor

AAverin commented Aug 5, 2020

@m0nac0 I have tested on 0.7.0 and it looks fine, although for some reasons tiles were not displaying.
Maybe it's some kind of caching issue, I will need to spend some more time on it.

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

No branches or pull requests

5 participants