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

dlopen failed: "/lib-main/libc++_shared.so" is for EM_ARM (40) instead of EM_386 (3) #59

Open
mfazekas opened this issue Apr 2, 2020 · 56 comments

Comments

@mfazekas
Copy link

mfazekas commented Apr 2, 2020

We're having .so loading error when running app on Android emulator R level. Doesn't seems to appear on API 29.

I've verified that the apk has correct architecture in the proper folder:

unzip ./android/app/build/outputs/apk/debug/app-debug.apk -d /tmp/apk-debug
gobjdump -f /tmp/apk-debug/lib/x86/*.so | grep arch
architecture: i386, flags 0x00000150:

After apk install the lib folder contains proper i386 .so-s.
But when starting the app the lib-main folder contains ARM .so-s.

See the relevant logcat in this gist
https://gist.github.com/mfazekas/c593726e061a59d265835ead1c5db0dd

Not sure if related but the log has those line:

2020-04-02 11:21:18.064 10842-10842/com.rnmapboxglexample D/ApkSoSource: allowing consideration of /data/app/~~fFkI_5OwU8XV6z9_a0xypA==/com.rnmapboxglexample-Lwh6zsqdqwYFSjqSz5i5rA==/lib/x86/libc++_shared.so: sysdir file length is 997224, but the file is 575328 bytes long in the APK

I can confirm that he file with length 997224 is 386. The arm version which is incorrectly used has 575328 bytes.

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

@mfazekas
Copy link
Author

mfazekas commented Apr 3, 2020

To reproduce:

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

@mfazekas
Copy link
Author

mfazekas commented Apr 10, 2020

Any input on the above?! I'd be happy to debug it, but I'd need some hints to where to look.

One thing that i found is that on old emulators - API 27 -
SysUtils.getSupportedAbis() return 'x86` only,

while on devices we're having the issue with - API R -
SysUtils.getSupportedAbis() return 'x86, armeabi-v7`

Apparently they do seems to have some support for both x86 and some kind of arm emulation.

https://developer.android.com/studio/releases/emulator#support_for_arm_binaries_on_android_9_and_11_system_images

@nickarora
Copy link

nickarora commented Jun 17, 2020

Can confirm that we are seeing the same thing. The error occurs on API 30 and API 28 but not API 29.

@sparebytes
Copy link

Upgrading from React-Native 0.61 to 0.63 solved it for us.

@AndreasBoehm
Copy link

I was running into the same issue but wasn't able to simply upgrade react-native because of some other dependencies.

The fix for this issue is part of SoLoader 0.8.1, you only need to force this dependency to a version higher than 0.8.0.

Root level build.gradle

allprojects {
    repositories {
        google()
        center()
		...

        // force dependency versions on all subprojects
        configurations.all {
            resolutionStrategy {

                // use 0.9.0 to fix crash on Android 11
                force "com.facebook.soloader:soloader:0.9.0"
			}
		}
	}
}

@izaanjahangir
Copy link

I was running into the same issue but wasn't able to simply upgrade react-native because of some other dependencies.

The fix for this issue is part of SoLoader 0.8.1, you only need to force this dependency to a version higher than 0.8.0.

Root level build.gradle

allprojects {
    repositories {
        google()
        center()
		...

        // force dependency versions on all subprojects
        configurations.all {
            resolutionStrategy {

                // use 0.9.0 to fix crash on Android 11
                force "com.facebook.soloader:soloader:0.9.0"
			}
		}
	}
}

This made my day. I was trying to make the apk from last 6 hours

@amirtabasi
Copy link

I was running into the same issue but wasn't able to simply upgrade react-native because of some other dependencies.

The fix for this issue is part of SoLoader 0.8.1, you only need to force this dependency to a version higher than 0.8.0.

Root level build.gradle

allprojects {
    repositories {
        google()
        center()
		...

        // force dependency versions on all subprojects
        configurations.all {
            resolutionStrategy {

                // use 0.9.0 to fix crash on Android 11
                force "com.facebook.soloader:soloader:0.9.0"
			}
		}
	}
}

this worked for me. thanks a lot.

@PatelDhrupal
Copy link

For OS 7 it is not working, for others it got fixed, any clue?

@sarthakpranesh
Copy link

I was running into the same issue but wasn't able to simply upgrade react-native because of some other dependencies.

The fix for this issue is part of SoLoader 0.8.1, you only need to force this dependency to a version higher than 0.8.0.

Root level build.gradle

allprojects {
    repositories {
        google()
        center()
		...

        // force dependency versions on all subprojects
        configurations.all {
            resolutionStrategy {

                // use 0.9.0 to fix crash on Android 11
                force "com.facebook.soloader:soloader:0.9.0"
			}
		}
	}
}

Thank you for this fix. It works in most cases but there are still some devices causing issues even after these changes. For example I have seen One Plus 8 Pro struggling with a similar issue (stack trace below) on Android 11

Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so caused by: couldn't find DSO to load: libc++_shared.so caused by: dlopen failed: "/data/data/com.myspinny.inspection.rn/lib-3/libc++_shared.so" is for EM_AARCH64 (183) instead of EM_X86_64 (62) result: 0 result: 0
       at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:896)
       at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:725)
       at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:649)
       at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:629)
       at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:577)
       at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit>(HermesExecutor.java:20)
       at com.facebook.hermes.reactexecutor.HermesExecutorFactory.create(HermesExecutorFactory.java:29)
       at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1024)
       at java.lang.Thread.run(Thread.java:923)

@cglacet
Copy link

cglacet commented Nov 26, 2022

@sarthakpranesh we had the same issue in the exact same setup.

@raldred
Copy link

raldred commented Feb 6, 2023

We're seeing this on devices such as Galaxy S9, One Plus 8, One Plus 5T,HUAWEI P30
All running Android 10.

React Native 0.70.6
React Native Gradle Plugin 0.70.3

@cglacet
Copy link

cglacet commented Feb 14, 2023

I though I had solved the issue by upgrading to soloader:0.10.4+ as suggested by Google support but it doesn't seems so.

Here is my current config on react native 0.71.2. In app/build.gradle I have something like this:

android {
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            // For each separate APK per architecture, set a unique version code as described here:
            // https://developer.android.com/studio/build/configure-apk-splits.html
            // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
            def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        defaultConfig.versionCode * 1000 + versionCodes.get(abi)
            }

        }
    }
}
dependencies {
    implementation 'com.facebook.soloader:soloader:0.10.4+'
}

In build.gradle I have:

allprojects {
    repositories {
        configurations.all {
            resolutionStrategy {
                force 'com.facebook.soloader:soloader:0.10.4+'
            }
	}
    }
}

@RohovDmytro
Copy link

@cglacet does it work in [email protected]?

@cglacet
Copy link

cglacet commented Feb 23, 2023

@RohovDmytro I have no idea, the problem with this issue is that I can't reproduce it myself, I only see crashlytics logs of customers experiencing the crash.

@anhkieet
Copy link

anhkieet commented Mar 1, 2023

We're seeing this on devices such as Galaxy S9, One Plus 8, One Plus 5T,HUAWEI P30 All running Android 10.

React Native 0.70.6 React Native Gradle Plugin 0.70.3

Have you fixed this issue yet?

@MC-HaoPhan
Copy link

I was running into the same issue but wasn't able to simply upgrade react-native because of some other dependencies.
The fix for this issue is part of SoLoader 0.8.1, you only need to force this dependency to a version higher than 0.8.0.
Root level build.gradle

allprojects {
    repositories {
        google()
        center()
		...

        // force dependency versions on all subprojects
        configurations.all {
            resolutionStrategy {

                // use 0.9.0 to fix crash on Android 11
                force "com.facebook.soloader:soloader:0.9.0"
			}
		}
	}
}

Thank you for this fix. It works in most cases but there are still some devices causing issues even after these changes. For example I have seen One Plus 8 Pro struggling with a similar issue (stack trace below) on Android 11

Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so caused by: couldn't find DSO to load: libc++_shared.so caused by: dlopen failed: "/data/data/com.myspinny.inspection.rn/lib-3/libc++_shared.so" is for EM_AARCH64 (183) instead of EM_X86_64 (62) result: 0 result: 0
       at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:896)
       at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:725)
       at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:649)
       at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:629)
       at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:577)
       at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit>(HermesExecutor.java:20)
       at com.facebook.hermes.reactexecutor.HermesExecutorFactory.create(HermesExecutorFactory.java:29)
       at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1024)
       at java.lang.Thread.run(Thread.java:923)

I have same issue

@JDouven
Copy link

JDouven commented May 5, 2023

We're also seeing this crash with RN 0.71.6 and SoLoader 0.10.4 on a OnePlus 8 Pro device running Android 11.

Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so caused by: couldn't find DSO to load: libjsi.so caused by: couldn't find DSO to load: libfolly_runtime.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/data/my.bundle.id/lib-3/libc++_shared.so" is for EM_AARCH64 (183) instead of EM_X86_64 (62) result: 0 result: 0 result: 0 result: 0 result: 0
       at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1127)
       at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943)
       at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:855)
       at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:802)
       at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:772)
       at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:26)
       at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit>(HermesExecutor.java:20)
       at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:24)

@cgorrieri
Copy link

cgorrieri commented May 12, 2023

I also have the error showing up in my crashlytics:

Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so caused by: couldn't find DSO to load: libjsi.so caused by: couldn't find DSO to load: libfolly_runtime.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/data/com.app..../lib-3/libc++_shared.so" is for EM_AARCH64 (183) instead of EM_X86_64 (62) result: 0 result: 0 result: 0 result: 0 result: 0
       at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1127)
       at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943)
       at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:855)
       at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:802)
       at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:772)
       at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:26)
       at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit>(HermesExecutor.java:20)
       at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:24)
       at com.facebook.react.ReactInstanceManagerBuilder.getDefaultJSExecutorFactory(ReactInstanceManagerBuilder.java:369)
       at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:316)
       at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:94)
       at expo.modules.ReactNativeHostWrapperBase.createReactInstanceManager(ReactNativeHostWrapperBase.kt:32)
       at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:41)
       at com.app.nohto.MainApplication.onCreate(MainApplication.java:67)

Device
Brand: OnePlus
Model: OnePlus8Pro
Operating system
Version: Android 11
Rooted: Yes

@vinnybad
Copy link

Ditto.

We're also seeing this crash with RN 0.71.6 and SoLoader 0.10.4 on a OnePlus 8 Pro device running Android 11.

Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so caused by: couldn't find DSO to load: libjsi.so caused by: couldn't find DSO to load: libfolly_runtime.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/data/my.bundle.id/lib-3/libc++_shared.so" is for EM_AARCH64 (183) instead of EM_X86_64 (62) result: 0 result: 0 result: 0 result: 0 result: 0
       at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1127)
       at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943)
       at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:855)
       at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:802)
       at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:772)
       at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:26)
       at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit>(HermesExecutor.java:20)
       at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:24)

I'm seeing this with oneplus8pro and soloader 10.5 as well:

implementation 'com.facebook.soloader:soloader:0.10.5+'

What's more confusing to me is: oneplus8pro seems to be a 64-bit ARM device, yet the code is expecting EM_X86_64 instead of EM_AARCH64...?

Unfortunately for now, I've had to shift away from using Hermes 😭 ... and since oneplus8pro is ARM 64-bit, it doesn't seem like I can build another bundle targeting just that...

Anyone have any other ideas on things to try?

@RamanDEEP225
Copy link

Anyone found solution @vinnybad @JDouven ?

@vinnybad
Copy link

Anyone found solution @vinnybad @JDouven ?

No for me

@giona69
Copy link

giona69 commented May 30, 2023

+1 we have same issue here, any solution lately?

@theobouwman
Copy link

We have the same issue on OnePlus.

@ucheNkadiCode
Copy link

ucheNkadiCode commented Jul 13, 2023

I'm on React Native 71.8 and I'm currently seeing this on Android 11 OnePlus devices.

Should I be worried about adding the line force "com.facebook.soloader:soloader:0.9.0" across all configurations? I understand this mainly helps Android 8 and some Android 11 devices. Will this mess up the other devices I have that are on Android 11, 12, and 13?

@vinnybad
Copy link

I'm on React Native 71.8 and I'm currently seeing this on Android 11 OnePlus devices.

Should I be worried about adding the line force "com.facebook.soloader:soloader:0.9.0" across all configurations? I understand this mainly helps Android 8 and some Android 11 devices. Will this mess up the other devices I have that are on Android 11, 12, and 13?

Do you have physical access to the device? If so, you could see if libhermes is missing on the device via adb.

@ucheNkadiCode
Copy link

I'm on React Native 71.8 and I'm currently seeing this on Android 11 OnePlus devices.
Should I be worried about adding the line force "com.facebook.soloader:soloader:0.9.0" across all configurations? I understand this mainly helps Android 8 and some Android 11 devices. Will this mess up the other devices I have that are on Android 11, 12, and 13?

Do you have physical access to the device? If so, you could see if libhermes is missing on the device via adb.

Apparently SoLoader issues are supposed to be fixed on React Native 72. I’ve just released a new version of my app and will see if that fixes it

@sergey-hippo
Copy link

sergey-hippo commented Jul 14, 2023

Our app is using RN 0.71.1, soloader:0.10.4 with hermesEnabled=true

We see 2 separate issues:

Issue 1

Reported on OnePlus8Pro, Android 11, similar to the original issue of this thread:

libc++_shared.so" is for EM_AARCH64 (183) instead of EM_X86_64 (62)
Complete stacktrace
Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so caused by: couldn't find DSO to load: libjsi.so caused by: couldn't find DSO to load: libfolly_runtime.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/data/com.hippo.release/lib-3/libc++_shared.so" is for EM_AARCH64 (183) instead of EM_X86_64 (62) result: 0 result: 0 result: 0 result: 0 result: 0
     at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1127)
     at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943)
     at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:855)
     at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:802)
     at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:772)
     at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:26)
     at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit>(HermesExecutor.java:20)
     at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:24)
     at com.facebook.react.ReactInstanceManagerBuilder.getDefaultJSExecutorFactory(ReactInstanceManagerBuilder.java:369)
     at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:316)
     at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:94)
     at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:41)
     at com.hippo.MainApplication.onCreate(MainApplication.java:63)
     at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1194)
     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6735)
     at android.app.ActivityThread.access$1300(ActivityThread.java:239)
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1915)
     at android.os.Handler.dispatchMessage(Handler.java:106)
     at android.os.Looper.loop(Looper.java:223)
     at android.app.ActivityThread.main(ActivityThread.java:7680)
     at java.lang.reflect.Method.invoke(Method.java)
     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

Caused by java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libjsi.so caused by: couldn't find DSO to load: libfolly_runtime.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/data/com.hippo.release/lib-3/libc++_shared.so" is for EM_AARCH64 (183) instead of EM_X86_64 (62) result: 0 result: 0 result: 0 result: 0
     at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1127)
     at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943)
     at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:841)
     at com.facebook.soloader.DirectorySoSource.loadDependencies(DirectorySoSource.java:177)
     at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:103)
     at com.facebook.soloader.UnpackingSoSource.loadLibrary(UnpackingSoSource.java:587)
     at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1067)
     at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943)
     at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:855)
     at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:802)
     at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:772)
     at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:26)
     at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit>(HermesExecutor.java:20)
     at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:24)
     at com.facebook.react.ReactInstanceManagerBuilder.getDefaultJSExecutorFactory(ReactInstanceManagerBuilder.java:369)
     at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:316)
     at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:94)
     at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:41)
     at com.hippo.MainApplication.onCreate(MainApplication.java:63)
     at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1194)
     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6735)
     at android.app.ActivityThread.access$1300(ActivityThread.java:239)
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1915)
     at android.os.Handler.dispatchMessage(Handler.java:106)
     at android.os.Looper.loop(Looper.java:223)
     at android.app.ActivityThread.main(ActivityThread.java:7680)
     at java.lang.reflect.Method.invoke(Method.java)
     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

Caused by java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libfolly_runtime.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/data/com.hippo.release/lib-3/libc++_shared.so" is for EM_AARCH64 (183) instead of EM_X86_64 (62) result: 0 result: 0 result: 0
     at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1127)
     at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943)
     at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:841)
     at com.facebook.soloader.DirectorySoSource.loadDependencies(DirectorySoSource.java:177)
     at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:103)
     at com.facebook.soloader.UnpackingSoSource.loadLibrary(UnpackingSoSource.java:587)
     at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1067)
     at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943)
     at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:841)
     at com.facebook.soloader.DirectorySoSource.loadDependencies(DirectorySoSource.java:177)
     at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:103)
     at com.facebook.soloader.UnpackingSoSource.loadLibrary(UnpackingSoSource.java:587)
     at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1067)
     at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943)
     at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:855)
     at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:802)
     at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:772)
     at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:26)
     at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit>(HermesExecutor.java:20)
     at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:24)
     at com.facebook.react.ReactInstanceManagerBuilder.getDefaultJSExecutorFactory(ReactInstanceManagerBuilder.java:369)
     at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:316)
     at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:94)
     at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:41)
     at com.hippo.MainApplication.onCreate(MainApplication.java:63)
     at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1194)
     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6735)
     at android.app.ActivityThread.access$1300(ActivityThread.java:239)
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1915)
     at android.os.Handler.dispatchMessage(Handler.java:106)
     at android.os.Looper.loop(Looper.java:223)
     at android.app.ActivityThread.main(ActivityThread.java:7680)
     at java.lang.reflect.Method.invoke(Method.java)
     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

Caused by java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libglog.so caused by: couldn't find DSO to load: libc++_shared.so caused by: dlopen failed: "/data/data/com.hippo.release/lib-3/libc++_shared.so" is for EM_AARCH64 (183) instead of EM_X86_64 (62) result: 0 result: 0
     at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1127)
     at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943)
     at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:841)
     at com.facebook.soloader.DirectorySoSource.loadDependencies(DirectorySoSource.java:177)
     at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:103)
     at com.facebook.soloader.UnpackingSoSource.loadLibrary(UnpackingSoSource.java:587)
     at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1067)
     at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943)
     at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:841)
     at com.facebook.soloader.DirectorySoSource.loadDependencies(DirectorySoSource.java:177)
     at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:103)
     at com.facebook.soloader.UnpackingSoSource.loadLibrary(UnpackingSoSource.java:587)
     at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1067)
     at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943)
     at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:841)
     at com.facebook.soloader.DirectorySoSource.loadDependencies(DirectorySoSource.java:177)
     at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:103)
     at com.facebook.soloader.UnpackingSoSource.loadLibrary(UnpackingSoSource.java:587)
     at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1067)
     at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943)
     at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:855)
     at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:802)
     at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:772)
     at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:26)
     at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit>(HermesExecutor.java:20)
     at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:24)
     at com.facebook.react.ReactInstanceManagerBuilder.getDefaultJSExecutorFactory(ReactInstanceManagerBuilder.java:369)
     at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:316)
     at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:94)
     at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:41)
     at com.hippo.MainApplication.onCreate(MainApplication.java:63)
     at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1194)
     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6735)
     at android.app.ActivityThread.access$1300(ActivityThread.java:239)
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1915)
     at android.os.Handler.dispatchMessage(Handler.java:106)
     at android.os.Looper.loop(Looper.java:223)
     at android.app.ActivityThread.main(ActivityThread.java:7680)
     at java.lang.reflect.Method.invoke(Method.java)
     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

Caused by java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libc++_shared.so caused by: dlopen failed: "/data/data/com.hippo.release/lib-3/libc++_shared.so" is for EM_AARCH64 (183) instead of EM_X86_64 (62) result: 0
     at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1127)
     at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943)
     at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:841)
     at com.facebook.soloader.DirectorySoSource.loadDependencies(DirectorySoSource.java:177)
     at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:103)
     at com.facebook.soloader.UnpackingSoSource.loadLibrary(UnpackingSoSource.java:587)
     at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1067)
     at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943)
     at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:841)
     at com.facebook.soloader.DirectorySoSource.loadDependencies(DirectorySoSource.java:177)
     at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:103)
     at com.facebook.soloader.UnpackingSoSource.loadLibrary(UnpackingSoSource.java:587)
     at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1067)
     at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943)
     at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:841)
     at com.facebook.soloader.DirectorySoSource.loadDependencies(DirectorySoSource.java:177)
     at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:103)
     at com.facebook.soloader.UnpackingSoSource.loadLibrary(UnpackingSoSource.java:587)
     at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1067)
     at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943)
     at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:841)
     at com.facebook.soloader.DirectorySoSource.loadDependencies(DirectorySoSource.java:177)
     at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:103)
     at com.facebook.soloader.UnpackingSoSource.loadLibrary(UnpackingSoSource.java:587)
     at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1067)
     at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943)
     at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:855)
     at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:802)
     at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:772)
     at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:26)
     at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit>(HermesExecutor.java:20)
     at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:24)
     at com.facebook.react.ReactInstanceManagerBuilder.getDefaultJSExecutorFactory(ReactInstanceManagerBuilder.java:369)
     at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:316)
     at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:94)
     at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:41)
     at com.hippo.MainApplication.onCreate(MainApplication.java:63)
     at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1194)
     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6735)
     at android.app.ActivityThread.access$1300(ActivityThread.java:239)
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1915)
     at android.os.Handler.dispatchMessage(Handler.java:106)
     at android.os.Looper.loop(Looper.java:223)
     at android.app.ActivityThread.main(ActivityThread.java:7680)
     at java.lang.reflect.Method.invoke(Method.java)
     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

Caused by java.lang.UnsatisfiedLinkError: dlopen failed: "/data/data/com.hippo.release/lib-3/libc++_shared.so" is for EM_AARCH64 (183) instead of EM_X86_64 (62)
     at java.lang.Runtime.load0(Runtime.java:942)
     at java.lang.System.load(System.java:1628)
     at com.facebook.soloader.SoLoader$1.load(SoLoader.java:558)
     at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:110)
     at com.facebook.soloader.UnpackingSoSource.loadLibrary(UnpackingSoSource.java:587)
     at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1067)
     at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943)
     at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:841)
     at com.facebook.soloader.DirectorySoSource.loadDependencies(DirectorySoSource.java:177)
     at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:103)
     at com.facebook.soloader.UnpackingSoSource.loadLibrary(UnpackingSoSource.java:587)
     at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1067)
     at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943)
     at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:841)
     at com.facebook.soloader.DirectorySoSource.loadDependencies(DirectorySoSource.java:177)
     at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:103)
     at com.facebook.soloader.UnpackingSoSource.loadLibrary(UnpackingSoSource.java:587)
     at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1067)
     at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943)
     at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:841)
     at com.facebook.soloader.DirectorySoSource.loadDependencies(DirectorySoSource.java:177)
     at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:103)
     at com.facebook.soloader.UnpackingSoSource.loadLibrary(UnpackingSoSource.java:587)
     at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1067)
     at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943)
     at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:841)
     at com.facebook.soloader.DirectorySoSource.loadDependencies(DirectorySoSource.java:177)
     at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:103)
     at com.facebook.soloader.UnpackingSoSource.loadLibrary(UnpackingSoSource.java:587)
     at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1067)
     at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943)
     at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:855)
     at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:802)
     at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:772)
     at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:26)
     at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit>(HermesExecutor.java:20)
     at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:24)
     at com.facebook.react.ReactInstanceManagerBuilder.getDefaultJSExecutorFactory(ReactInstanceManagerBuilder.java:369)
     at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:316)
     at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:94)
     at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:41)
     at com.hippo.MainApplication.onCreate(MainApplication.java:63)
     at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1194)
     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6735)
     at android.app.ActivityThread.access$1300(ActivityThread.java:239)
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1915)
     at android.os.Handler.dispatchMessage(Handler.java:106)
     at android.os.Looper.loop(Looper.java:223)
     at android.app.ActivityThread.main(ActivityThread.java:7680)
     at java.lang.reflect.Method.invoke(Method.java)
     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

It's interesting, that One Plus 8 is also mentioned by @raldred

We're seeing this on devices such as Galaxy S9, One Plus 8, One Plus 5T,HUAWEI P30

The chipsets and their respective instruction sets are as follows:

  • Galaxy S9: Qualcomm Snapdragon 845 (ARMv8-A) for US version and Samsung Exynos 9810 (ARMv8-A) for international
  • One Plus 8: Qualcomm Snapdragon 865 (ARMv8.2-A)
  • One Plus 5T: Qualcomm Snapdragon 835 (ARMv8-A)
  • HUAWEI P30: HiSilicon Kirin 980 (ARMv8.2-A)

So all of those devices are AARCH64 and it's unclear why the error says instead of EM_X86_64

Issue 2

Reported on Nexus 5X, Android 8.1.0:

couldn't find DSO to load: libhermes.so
Complete stacktrace
Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so
  SoSource 0: com.facebook.soloader.DirectorySoSource[root = /data/app/com.hippo.release-eBL8a5gFXjfFvoGTEd61Mg==/lib/x86 flags = 0]
  SoSource 1: com.facebook.soloader.DirectApkSoSource[root = ()]
  SoSource 2: com.facebook.soloader.DirectorySoSource[root = /vendor/lib flags = 2]
  SoSource 3: com.facebook.soloader.DirectorySoSource[root = /system/lib flags = 2]
  Native lib dir: /data/app/com.hippo.release-eBL8a5gFXjfFvoGTEd61Mg==/lib/x86
result: 0
     at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1127)
     at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943)
     at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:855)
     at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:802)
     at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:772)
     at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:26)
     at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit>(HermesExecutor.java:20)
     at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:24)
     at com.facebook.react.ReactInstanceManagerBuilder.getDefaultJSExecutorFactory(ReactInstanceManagerBuilder.java:369)
     at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:316)
     at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:94)
     at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:41)
     at com.hippo.MainApplication.onCreate(MainApplication.java:63)
     at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1119)
     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5740)
     at android.app.ActivityThread.-wrap1()
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
     at android.os.Handler.dispatchMessage(Handler.java:106)
     at android.os.Looper.loop(Looper.java:164)
     at android.app.ActivityThread.main(ActivityThread.java:6494)
     at java.lang.reflect.Method.invoke(Method.java)
     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

This one is different from original issue of this thread.

@psdewar
Copy link

psdewar commented Jul 31, 2023

@cglacet what's the functional difference between adding com.facebook.soloader:soloader:0.10.4+ as a dependency in android/app/build.gradle vs. as a resolutionStrategy in android/build.gradle?

@Jamal-ReachFirst
Copy link

I'm on React Native 71.8 and I'm currently seeing this on Android 11 OnePlus devices.
Should I be worried about adding the line force "com.facebook.soloader:soloader:0.9.0" across all configurations? I understand this mainly helps Android 8 and some Android 11 devices. Will this mess up the other devices I have that are on Android 11, 12, and 13?

Do you have physical access to the device? If so, you could see if libhermes is missing on the device via adb.

Apparently SoLoader issues are supposed to be fixed on React Native 72. I’ve just released a new version of my app and will see if that fixes it

fixed??

@ucheNkadiCode
Copy link

I'm on React Native 71.8 and I'm currently seeing this on Android 11 OnePlus devices.
Should I be worried about adding the line force "com.facebook.soloader:soloader:0.9.0" across all configurations? I understand this mainly helps Android 8 and some Android 11 devices. Will this mess up the other devices I have that are on Android 11, 12, and 13?

Do you have physical access to the device? If so, you could see if libhermes is missing on the device via adb.

Apparently SoLoader issues are supposed to be fixed on React Native 72. I’ve just released a new version of my app and will see if that fixes it

fixed??

Yes it was fixed for me! My Android applications haven’t been getting this sort of crash since I did the work to upgrear to my React Native 72 version. I didn’t do any of the other SoLoader hacks at all

@malikzype
Copy link

+1 Still facing issues

@Pingou
Copy link

Pingou commented Aug 17, 2023

Yes it was fixed for me! My Android applications haven’t been getting this sort of crash since I did the work to upgrear to my React Native 72 version. I didn’t do any of the other SoLoader hacks at all

Still getting

Fatal Exception: java.lang.UnsatisfiedLinkError
dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/myapp-KP_lyfJO9YCo9WMKKk39Pg==/base.apk"],nativeLibraryDirectories=[/data/app/myapp-KP_lyfJO9YCo9WMKKk39Pg==/lib/arm64, /system/lib64, /system/vendor/lib64]]] couldn't find "libhermes.so"

after upgrading to rn 0.72 but not having

dlopen failed: "/lib-main/libc++_shared.so" is for EM_ARM (40) instead of EM_386 error anymore

@Jamal-ReachFirst
Copy link

Jamal-ReachFirst commented Aug 17, 2023

+1 Still facing issues

This work for me

project.ext.react = [
    enableHermes: true,  // clean and rebuild if changing
]
if (enableHermes) {
    //  def hermesPath = "../../node_modules/hermes-engine/android/";
    //  debugImplementation files(hermesPath + "hermes-debug.aar")
    //  releaseImplementation files(hermesPath + "hermes-release.aar"  
    implementation("com.facebook.react:hermes-engine:0.69.12") {  // replace the RN version with the one you are using
        exclude group:'com.facebook.fbjni'
    }
} else {
     implementation jscFlavor
}

I'm using:

"react-native": "0.69.12",

@Youssef-Durgham
Copy link

Youssef-Durgham commented Aug 26, 2023

did any one fix that ?

@nmateo
Copy link

nmateo commented Sep 15, 2023

Still happening to some devices:

Nexus 5X
One plus 8 pro

React-Native 0.72.4
Android NDK 23.1.7779620
minSdkVersion 21
compileSdkVersion 33
targetSdkVersion 33

Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so caused by: couldn't find DSO to load: libjsi.so caused by: couldn't find DSO to load: libfolly_runtime.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/data/fr.waeve.mob/lib-3/libc++_shared.so" is for EM_AARCH64 (183) instead of EM_X86_64 (62) result: 0 result: 0 result: 0 result: 0 result: 0
       at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1228)
       at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:1044)
       at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:956)
       at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:903)
       at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:869)
       at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:26)
       at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit>(HermesExecutor.java:20)
       at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:24)
       at com.facebook.react.ReactInstanceManagerBuilder.getDefaultJSExecutorFactory(ReactInstanceManagerBuilder.java:379)
       at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:325)
       at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:96)
       at expo.modules.ReactNativeHostWrapperBase.createReactInstanceManager(ReactNativeHostWrapperBase.kt:32)
       at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:42)
       at fr.waeve.mob.MainApplication.onCreate(MainApplication.java:76)
       at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1194)
       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6735)
       at android.app.ActivityThread.access$1300(ActivityThread.java:239)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1915)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:223)
       at android.app.ActivityThread.main(ActivityThread.java:7680)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:423)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

@ArditGashi
Copy link

ArditGashi commented Oct 2, 2023

We have the same issue.

Android 8 & 11
Nexus 5X
One Plus 8 Pro

"react-native": "0.72.4"


Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so
       at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1228)
       at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:1044)
       at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:956)
       at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:903)
       at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:869)
       at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:26)
       at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit>(HermesExecutor.java:20)
       at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:24)
       at com.facebook.react.ReactInstanceManagerBuilder.getDefaultJSExecutorFactory(ReactInstanceManagerBuilder.java:379)
       at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:325)
       at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:96)
       at expo.modules.ReactNativeHostWrapperBase.createReactInstanceManager(ReactNativeHostWrapperBase.kt:32)
       at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:42)
       at dk.guloggratis.MainApplication.onCreate(MainApplication.java:71)
       at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1119)
       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5740)
       at android.app.ActivityThread.-wrap1()
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:164)
       at android.app.ActivityThread.main(ActivityThread.java:6494)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

@Jeffreyoboe1
Copy link

Jeffreyoboe1 commented Nov 3, 2023

Same issue,

One Plus 8 Pro
Android 11

"react-native": "0.71.3"

if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
} else {
implementation jscFlavor
}

Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so caused by: couldn't find DSO to load: libjsi.so caused by: couldn't find DSO to load: libfolly_runtime.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/data/{mypackagename}/lib-3/libc++_shared.so" is for EM_AARCH64 (183) instead of EM_X86_64 (62) result: 0 result: 0 result: 0 result: 0 result: 0

@MatthewPattell
Copy link

Same issue,

One Plus 8 Pro Android 11

"react-native": "0.71.3"

if (hermesEnabled.toBoolean()) { implementation("com.facebook.react:hermes-android") } else { implementation jscFlavor }

Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so caused by: couldn't find DSO to load: libjsi.so caused by: couldn't find DSO to load: libfolly_runtime.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/data/{mypackagename}/lib-3/libc++_shared.so" is for EM_AARCH64 (183) instead of EM_X86_64 (62) result: 0 result: 0 result: 0 result: 0 result: 0

The same for me((

@matheusleite
Copy link

Same issue,
One Plus 8 Pro Android 11
"react-native": "0.71.3"
if (hermesEnabled.toBoolean()) { implementation("com.facebook.react:hermes-android") } else { implementation jscFlavor }
Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so caused by: couldn't find DSO to load: libjsi.so caused by: couldn't find DSO to load: libfolly_runtime.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/data/{mypackagename}/lib-3/libc++_shared.so" is for EM_AARCH64 (183) instead of EM_X86_64 (62) result: 0 result: 0 result: 0 result: 0 result: 0

The same for me((

The same for me too!
Using RN 0.66.5

@jfbourne
Copy link

jfbourne commented Dec 29, 2023

Seeing this issue as well.

RN: 0.72.7

` buildToolsVersion = "33.0.0"
minSdkVersion = 23
compileSdkVersion = 33
targetSdkVersion = 33
kotlin_version = '1.6.10' // <- add this line
ndkVersion = "21.4.7075529"

    react = [
        enableHermes: true,     // clean and rebuild if changing
        enableVmCleanup: false, //this
    ] `

Brand:Google
Model:Pixel 6 Pro
Orientation:Portrait
RAM free: 1.88 GB
Disk free: 1.58 GB

Operating System
Version:Android 12
Orientation:Portrait
Rooted:No

Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so caused by: couldn't find DSO to load: libjsi.so caused by: couldn't find DSO to load: libfolly_runtime.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/data/watch.panpan/lib-3/libc++_shared.so" is for EM_AARCH64 (183) instead of EM_X86_64 (62) result: 0 result: 0 result: 0 result: 0 result: 0 at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1127) at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943) at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:855) at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:802) at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:772) at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:26)

@ErikTromp
Copy link

Here too on RN 0.72.4, all OnePlus8Pro devices

@joaovitorleffa
Copy link

Same here, OnePlus8Pro and RN 0.63.0

@ellaschwarz
Copy link

Same here, OnePlus8Pro and react-native 0.72.6

@scblason
Copy link

Same here, OnePlus8Pro on 0.70.6

@tolypash
Copy link

Same here on OnePlus8Pro device and react-native 0.72.6.

@ErikTromp
Copy link

In my case, I managed to fix this by finding an actual underlying error. What that is, is impossible to properly tell generically but it turned out that while I saw these errors in Firebase, there was another actual error in my code (using some non existing state) that I fixed and never made this show up in Firebase anymore.

My suggestion: look at the screen/place where Firebase says this error occurs and debug everything on that screen.

@ozberkjustlife
Copy link

Same error on 0.71.4 react native version.

@dmacpro91
Copy link

We're also experiencing this only on OnePlus8Pro models.

dlopen failed: "/data/data/com.dmacpro91.app/lib-3/libc++_shared.so" is for EM_AARCH64 (183) instead of EM_X86_64 (62)

RN 0.66.1

@rgomezp
Copy link

rgomezp commented Aug 10, 2024

Still getting this issue

@scarlac
Copy link

scarlac commented Sep 16, 2024

I'm seeing production crashes from OnePlus 8 Pro phones that are unrelated to libhermes or libc++, but instead self-developed libraries that I know are bundled with my app but somehow fail to load on this particular phone, OnePlus 8 Pro (Android 11). In my case, it's 1 user that keeps generating crashes but appearing as if they were multiple users in Crashlytics.

Here's some info for Google to pick up:

AppPackage.createNativeModules
java.lang.UnsatisfiedLinkError - dlopen failed: library "libmylib.so" not found

The code that triggers the dlopen is the following:

class MyRNModule(val context: ReactApplicationContext?) : ReactContextBaseJavaModule(
    context
), LifecycleEventListener {
  init {
    // ...
    System.loadLibrary("mylib") // this causes a crash
  }
  // ...

I do not know what the solution is. It could be that .so files need to be moved to a specific location to support OnePlus phones, or that OnePlus simply has a bug in their flavor of Android 11 (OxygenOS). Or it could be a virus scanner or system blocking mechanism. Or finally it could also be related to OnePlus devices trying to load the x86-variants of libraries despite the CPUs being ARM-based.

Possible thing to try (I don't have a OnePlus device to test with):
Change the android/app/build.gradle file to remove the x86 ABI, to avoid any bundling of x86:

ndk {
-  abiFilters 'x86_64', 'armeabi-v7a', 'arm64-v8a'
+  abiFilters 'armeabi-v7a', 'arm64-v8a'
}

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