Maps: The example app (v8.0.0-rc1) crashes on an emulator with API level R

Created on 19 Mar 2020  路  10Comments  路  Source: react-native-mapbox-gl/maps

Describe the bug
The example app crashes while loading on an android virtual device with API R (Pixel XL API R).
The following is the output of adb logcat *:E

03-18 23:54:38.134  2067  2319 E SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
03-18 23:54:38.326 12024 12024 E SoLoader: couldn't find DSO to load: libc++_shared.so caused by: dlopen failed: "/data/user/0/com.rnmapboxglexample/lib-main/libc++_shared.so" is for EM_ARM (40) instead of EM_386 (3)
03-18 23:54:38.334 12024 12024 E SoLoader: couldn't find DSO to load: libfb.so caused by: couldn't find DSO to load: libc++_shared.so caused by: dlopen failed: "/data/user/0/com.rnmapboxglexample/lib-main/libc++_shared.so" is for EM_ARM (40) instead of EM_386 (3)
03-18 23:54:38.350 12024 12024 E SoLoader: couldn't find DSO to load: libjscexecutor.so caused by: couldn't find DSO to load: libfb.so caused by: couldn't find DSO to load: libc++_shared.so caused by: dlopen failed: "/data/user/0/com.rnmapboxglexample/lib-main/libc++_shared.so" is for EM_ARM (40) instead of EM_386 (3)
03-18 23:54:38.410  2067  2067 E Layer   : [Surface(name=ActivityRecord{756b77a u0 com.google.android.apps.nexuslauncher/.NexusLauncherActivity)/@0x41480aa - animation-leash#0] No local sync point found
03-18 23:54:38.410  2067  2067 E Layer   : [Surface(name=ActivityRecord{83f5470 u0 com.rnmapboxglexample/.MainActivity)/@0xaaec2a3 - animation-leash#0] No local sync point found
03-18 23:54:38.434  2067  2067 E Layer   : [Surface(name=ActivityRecord{756b77a u0 com.google.android.apps.nexuslauncher/.NexusLauncherActivity)/@0x41480aa - animation-leash#0] No local sync point found
03-18 23:54:38.434  2067  2067 E Layer   : [Surface(name=ActivityRecord{83f5470 u0 com.rnmapboxglexample/.MainActivity)/@0xaaec2a3 - animation-leash#0] No local sync point found
03-18 23:54:39.215  2275  2397 E InputDispatcher: channel '5e48721 Splash Screen com.rnmapboxglexample (server)' ~ Channel is unrecoverably broken and will be disposed!
03-18 23:54:39.348  2108  2197 E IPCThreadState: binder thread pool (1 threads) starved for 138 ms
03-18 23:54:40.008 12024 12061 E SoLoader: couldn't find DSO to load: libc++_shared.so caused by: dlopen failed: "/data/user/0/com.rnmapboxglexample/lib-main/libc++_shared.so" is for EM_ARM (40) instead of EM_386 (3)
03-18 23:54:40.013 12024 12061 E SoLoader: couldn't find DSO to load: libglog.so caused by: couldn't find DSO to load: libc++_shared.so caused by: dlopen failed: "/data/user/0/com.rnmapboxglexample/lib-main/libc++_shared.so" is for EM_ARM (40) instead of EM_386 (3)
03-18 23:54:40.017 12024 12061 E SoLoader: couldn't find DSO to load: libglog_init.so caused by: couldn't find DSO to load: libglog.so caused by: couldn't find DSO to load: libc++_shared.so caused by: dlopen failed: "/data/user/0/com.rnmapboxglexample/lib-main/libc++_shared.so" is for EM_ARM (40) instead of EM_386 (3)
03-18 23:54:40.019 12024 12061 E SoLoader: couldn't find DSO to load: libreactnativejni.so caused by: couldn't find DSO to load: libglog_init.so caused by: couldn't find DSO to load: libglog.so caused by: couldn't find DSO to load: libc++_shared.so caused by: dlopen failed: "/data/user/0/com.rnmapboxglexample/lib-main/libc++_shared.so" is for EM_ARM (40) instead of EM_386 (3)
03-18 23:54:40.032 12024 12061 E AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
03-18 23:54:40.032 12024 12061 E AndroidRuntime: Process: com.rnmapboxglexample, PID: 12024
03-18 23:54:40.032 12024 12061 E AndroidRuntime: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libreactnativejni.so caused by: couldn't find DSO to load: libglog_init.so caused by: couldn't find DSO to load: libglog.so caused by: couldn't find DSO to load: libc++_shared.so caused by: dlopen failed: "/data/user/0/com.rnmapboxglexample/lib-main/libc++_shared.so" is for EM_ARM (40) instead of EM_386 (3)
03-18 23:54:40.032 12024 12061 E AndroidRuntime:    at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:789)
03-18 23:54:40.032 12024 12061 E AndroidRuntime:    at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:639)
03-18 23:54:40.032 12024 12061 E AndroidRuntime:    at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:577)
03-18 23:54:40.032 12024 12061 E AndroidRuntime:    at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:525)
03-18 23:54:40.032 12024 12061 E AndroidRuntime:    at com.facebook.react.bridge.ReactBridge.staticInit(ReactBridge.java:31)
03-18 23:54:40.032 12024 12061 E AndroidRuntime:    at com.facebook.react.bridge.Inspector.<clinit>(Inspector.java:19)
03-18 23:54:40.032 12024 12061 E AndroidRuntime:    at com.facebook.react.bridge.Inspector.getPages(Inspector.java:26)
03-18 23:54:40.032 12024 12061 E AndroidRuntime:    at com.facebook.react.devsupport.InspectorPackagerConnection.getPages(InspectorPacka
03-18 23:54:40.150  2275  2397 E InputDispatcher: channel 'ef610da PopupWindow:35efacf (server)' ~ Channel is unrecoverably broken and will be disposed!
03-18 23:54:40.151  2275  2397 E InputDispatcher: channel 'a0d2ecd com.rnmapboxglexample/com.rnmapboxglexample.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!

To Reproduce
Run the example app on an Android Virtual Device with API R.

Expected behavior
The example app to run without crashing.

Versions (please complete the following information):

  • Platform: Android
  • Device: Pixel XL
  • Emulator/ Simulator: yes
  • OS: API level R
  • SDK Version: 8.0.0-rc1
  • React Native Version: 0.61.5
Android upstream wontfix

Most helpful comment

All 10 comments

You're right. I've seen those bug reports, they are both closed but the issue is still there.
I noticed the last version which doesn't crash on R is 7.0.8. All versions after that crash.
That's why I've reported this bug.

@m12i thanks for the report. I was able to reproduce it on R.
Strange that the same apk works on 27/28 but fails on R, both x86, so not sure, what's going on.

Same thing on iOS, my app instantly crashes on the latest version. I spent hours figuring out what was going on then I tried 7.0.8 after seeing @m12i 's comment and now everything works perfectly.

@magax i've removed your comment. Please be specific and include details about the crash, without that we have no way to identify yet alone solve the issue you're talking about.

The issue in this bug report is definitely android specific.

see mapbox/mapbox-gl-native-android#111

I've did a bit of troubleshooting:

sh mkdir /tmp/apk-debug brew install binutils unzip ./android/app/build/outputs/apk/debug/app-debug.apk -d /tmp/apk-debug /usr/local/opt/binutils/bin/gobjdump -f /tmp/apk-debug/lib/x86_64/libmapbox-gl.so ~/Library/Android/sdk/platform-tools/adb pull /data/user/0/com.rnmapboxglexample/lib-main/libmapbox-gl.so /usr/local/opt/binutils/bin/gobjdump -f libmapbox-gl.so /usr/local/opt/binutils/bin/gobjdump -f /tmp/apk-debug/lib/x86_64/*.so | grep arch architecture: i386:x86-64, flags 0x00000150: architecture: i386:x86-64, flags 0x00000150: architecture: i386:x86-64, flags 0x00000150: architecture: i386:x86-64, flags 0x00000150: architecture: i386:x86-64, flags 0x00000150: architecture: i386:x86-64, flags 0x00000150: architecture: i386:x86-64, flags 0x00000150: architecture: i386:x86-64, flags 0x00000150: architecture: i386:x86-64, flags 0x00000150: architecture: i386:x86-64, flags 0x00000150: architecture: i386:x86-64, flags 0x00000150: architecture: i386:x86-64, flags 0x00000150: architecture: i386:x86-64, flags 0x00000150: architecture: i386:x86-64, flags 0x00000150: architecture: i386:x86-64, flags 0x00000150: architecture: i386:x86-64, flags 0x00000150:

So apk looks to be fine for me. x86_64 contains so for x86_64. When installed on device, the lib directory contains 386 object, but the lib-main incorrectly contains ARM versions.

~/Library/Android/sdk/platform-tools/adb install ./android/app/build/outputs/apk/debug/app-debug.apk

~/Library/Android/sdk/platform-tools/adb pull /data/user/0/com.rnmapboxglexample/lib/libmapbox-gl.so
 /usr/local/opt/binutils/bin/gobjdump -f ./libmapbox-gl.so 
architecture: i386, flags 0x00000150:

but after starting the app lib-main contains all arm objects:
~/Library/Android/sdk/platform-tools/adb pull /data/user/0/com.rnmapboxglexample/lib-main
/usr/local/opt/binutils/bin/gobjdump -f lib-main/lib*.so | grep arch
architecture: armv7, flags 0x00000150:
architecture: armv7, flags 0x00000150:
architecture: armv7, flags 0x00000150:
architecture: armv7, flags 0x00000150:

To reproduce the issue:

react-native init mapboxtest2 --version 0.61.1
cd mapboxtest2
npm install @react-native-mapbox-gl/[email protected] --save
adb shell pm uninstall com.mapboxtest2
react-native run-android
# also start adb logcat to observe the soLoader error

Upgrading to gradle 3.5.2 from 3.4.2 seems to solve the issue.
Upgrading to gradle 3.5.2 does not solve the issue.

edit ./android/build.gradle
# change to classpath("com.android.tools.build:gradle:3.5.2")
edit ./android/app
cd ./andoird 
./gradlew clean
cd ..
adb shell pm uninstall com.mapboxtest2
react-native run-android

@mfazekas , seems a new native android version is out for mapbox with the fix: https://github.com/mapbox/mapbox-gl-native-android/issues/111#issuecomment-625579031

Any plans on updating the react-native repo to pull the latest android version for mapbox? Thanks!!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings