-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
[Android] Couldn't find DSO to load crash in release build and hermes is enabled #33120
Comments
You can't use |
Shall i remove the packagingOptions itself. Previously it was introduced to reduce the app size. |
This is also happening in my Android environment. Multiple logs of Logs02-22 18:00:04.412 9890 9890 E AndroidRuntime: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libjscexecutor.so 02-22 21:42:28.406 3548 3548 E SoLoader: couldn't find DSO to load: libjscexecutor.so caused by: dlopen failed: library "libjsc.so" not found result: 0 02-22 21:48:22.995 4603 4603 E SoLoader: couldn't find DSO to load: libjscexecutor.so 02-22 21:48:23.033 4603 4603 E SoLoader: couldn't find DSO to load: libhermes-inspector.so caused by: dlopen failed: cannot locate symbol "_ZTIN8facebook6hermes8debugger13EventObserverE" referenced by "/data/data/jp.exampleapp.canary/lib-main/libhermes-inspector.so"... result: 0 02-22 21:48:23.034 4603 4603 W System.err: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes-inspector.so caused by: dlopen failed: cannot locate symbol "_ZTIN8facebook6hermes8debugger13EventObserverE" referenced by "/data/data/jp.exampleapp.canary/lib-main/libhermes-inspector.so"... result: 0 02-22 21:48:23.034 4603 4603 E SoLoader: couldn't find DSO to load: libhermes-executor-common-debug.so caused by: couldn't find DSO to load: libhermes-inspector.so caused by: dlopen failed: cannot locate symbol "_ZTIN8facebook6hermes8debugger13EventObserverE" referenced by "/data/data/jp.exampleapp.canary/lib-main/libhermes-inspector.so"... result: 0 result: 0 02-22 21:48:23.034 4603 4603 W System.err: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes-executor-common-debug.so caused by: couldn't find DSO to load: libhermes-inspector.so caused by: dlopen failed: cannot locate symbol "_ZTIN8facebook6hermes8debugger13EventObserverE" referenced by "/data/data/jp.exampleapp.canary/lib-main/libhermes-inspector.so"... result: 0 result: 0 02-22 21:48:23.034 4603 4603 W System.err: Caused by: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes-inspector.so caused by: dlopen failed: cannot locate symbol "_ZTIN8facebook6hermes8debugger13EventObserverE" referenced by "/data/data/jp.exampleapp.canary/lib-main/libhermes-inspector.so"... result: 0 02-22 21:48:23.035 4603 4603 E SoLoader: couldn't find DSO to load: libhermes-executor-debug.so caused by: couldn't find DSO to load: libhermes-executor-common-debug.so caused by: couldn't find DSO to load: libhermes-inspector.so caused by: dlopen failed: cannot locate symbol "_ZTIN8facebook6hermes8debugger13EventObserverE" referenced by "/data/data/jp.exampleapp.canary/lib-main/libhermes-inspector.so"... result: 0 result: 0 result: 0 02-22 21:48:23.035 4603 4603 E SoLoader: couldn't find DSO to load: libhermes-executor-release.so 02-22 21:48:23.036 4603 4603 W System.err: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes-executor-release.so 02-22 21:48:23.036 4603 4603 E AndroidRuntime: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libjscexecutor.sonpx react-native infoSystem: #33065, #33079 also looks like a very similar Issue. However, each seems to have a different version of RN. Is there a widespread impact on the release build? ※This problem did not occur in the debug build |
@urbanclap-admin It depends on your setup. Technically you don't need it, but there might be a library that requires it.
@1natsu172 So this looks like a problem in your build. Essentially if you pick JSC as engine, your APK should have If you could provide a reproducer, I could look more closely into it. |
@cortinico #33177 also seems to have the same report as me, so it seems that the change around #32281 has some effect. The |
@1natsu172 where should i insert deleteDebugFilesForVariant: { true }? Thank you in advance. |
@joaotmachado at your |
Good news. Solved with this issue: [https://github.com//issues/25537#issuecomment-526562565]. |
Hello, |
Same story |
Closing as there was no reproducer provided and we can't really look into this issue, without a proper reproducer. |
Hi @cortinico, I'm not sure how closing this issue helps the project. I'm sure a lot of M1 Mac users would be experiencing this issue, maybe or not related to not having Rosetta present. But I have not been successful with a release apk for Android, most likely because I don't need Rosetta. The same source code builds a successfully running release apk when built from an Intel Mac. I've applied a lot of suggestions that are out there. None of them has worked. How do I help you in reproducing this issue? |
If you're still experiencing this problem:
|
This worked for me |
This worked for me as well, thanks! |
Thanks! |
I already had this, but it still not working. |
Don't know if this will help you, but in package.json, besides react-native-animated, I also bumped to the latest version:
|
i fix this. you can override getJavaScriptExecutorFactory in your ReactNativeHost if you use hermes,force JSExecutorFactory use hermesExecutorFactory
|
Found a fix for the issue with hermes: Change:
to:
for example, for mine I used:
|
This works for me too, but would like to understand why |
@brycnguyen read here: #35210 |
The only thing that worked for me was disabling Hermes in app/build.gradle
|
@Nesh108 Thanks! that's helpful. Looks like the issue was resolved in the patch via react-native 0.69.7. I tried out that version and it works, however I use Expo so the pinned version is 0.69.6 so I could not simply use that version. I had to make a custom expo config plugin and instead made the change in project build gradle:
|
please refer to the following comment to sort this out #33177 (comment). Most likely, you have custom build variants, so you need to configure |
I have the same issue on RN 70.6 |
Was upgrading from and older version of react native + expo modules to latest 0.70.5...this fixed the issue for me...thanks man |
=> so beatifulllll, love you |
Edit: Sorry for the repost, I did not see the comment above! try to add this to app/build.gradle
Taken from: |
This bug still happens in some devices:
Version: Crash 1:
Crash 2:
|
If you're using ProGuard so you need to add the following rule to android/app/proguard-rules.pro:
This is mentioned in Breaking change of v0.62.0 changelog. https://github.com/react-native-community/releases/blob/master/CHANGELOG.md#breaking |
@TVGSOFT did you ever find a way to fix those crashes on OnePlus8 and those other devices? I also am still seeing some of my users get Crashes due to this error. I am NOT using the Hermes engine and I am NOT using Expo either. but I am using RN 71.6. Any help would be appreciated. |
1 similar comment
@TVGSOFT did you ever find a way to fix those crashes on OnePlus8 and those other devices? I also am still seeing some of my users get Crashes due to this error. I am NOT using the Hermes engine and I am NOT using Expo either. but I am using RN 71.6. Any help would be appreciated. |
having the same issue, RN 0.71.0 using Hermes and ProGuard ( with -keep class com.facebook.jni.** { *; }) |
Here too. Very same errors for OnePlus8Pro. |
@cortinico could we consider reopening this? This crash has led to plenty of uninstalls for my app. It’s clear that this is affecting users still to this day |
Same issue with react native 0.71.6
|
This issue is a duplicate of #37336 and #37404 and others. |
SOLVED This issue took a good chunk of my day. I tested almost all the solutions proposed. But ultimately, the solutions provided here worked! |
How do I do that in an Expo app |
What data they should collect then? Please elaborate. |
@sergey-hippo I would need a project created from this template: That I can build locally, and where the app crashes consistently with the error message you're reprorting about. |
@cortinico sounds good, thanks! One question though: what if we have an issue that's only reproducible on certain devices, like facebook/SoLoader#59? |
That makes things harder as we'll have to find that specific device to potentially fix the issue. |
you are number 1. Work for me |
Firebase crash report Error:
I am using cli:
|
I am facing this issue in release build and and logs. Caused by java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libjsi.so caused by: couldn't find DSO to load: libfolly_json.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.northwest.alaskacommercial/lib-3/libc++_shared.so" is for EM_AARCH64 (183) instead of EM_X86_64 (62) result: 0 result: 0 result: 0 result: 0 Caused by java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libfolly_json.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.northwest.alaskacommercial/lib-3/libc++_shared.so" is for EM_AARCH64 (183) instead of EM_X86_64 (62) result: 0 result: 0 result: 0 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.northwest.alaskacommercial/lib-3/libc++_shared.so" is for EM_AARCH64 (183) instead of EM_X86_64 (62) result: 0 result: 0 Caused by java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libc++_shared.so caused by: dlopen failed: "/data/data/com.northwest.alaskacommercial/lib-3/libc++_shared.so" is for EM_AARCH64 (183) instead of EM_X86_64 (62) result: 0 Caused by java.lang.UnsatisfiedLinkError: dlopen failed: "/data/data/com.northwest.alaskacommercial/lib-3/libc++_shared.so" is for EM_AARCH64 (183) instead of EM_X86_64 (62) Firebase-Messaging-Init: pool-2-thread-1: GmsDynamite: Firebase-Messaging-Topics-Io: com.google.firebase.crashlytics.startup1: FinalizerDaemon: OkHttp ConnectionPool: main: Okio Watchdog: ReferenceQueueDaemon: Crashlytics Exception Handler1: awaitEvenIfOnMainThread task continuation executor1: queued-work-looper: ScionFrontendApi: FinalizerWatchdogDaemon: Measurement Worker: |
I have the same crash on the following devices:
It started showing up after the react-native update to 0.70.8 and expo 47.0.0 with hermes enabled |
Same here, happening with Nexus 5 on Android 8.1 react-native 0.72.6 |
I can confirm also happening i raised this here with repo: react-navigation/react-navigation#11673 |
I had a similar problem when migrating to react 0.73 which updates gradle to version 8.x. I don't know if it will help anyone but all contributions are welcome and since it solved my problem, I hope it helps someone. So... When adding an AAR library, I got this error because the To check this, I did: I did the same thing again, now with the dependency that crashes the app. I did the procedure above and noticed that the 1 - I created a folder android {
...
sourceSets {
main {
jniLibs.srcDir 'src/jniLibs'
}
}
...
}
dependencies {
implementation files('libs/<module1>.aar')
....
implementation files('libs/<module_x>.aar')
} If you do pickFirst through In my case it worked, but be aware that this can create other problems. |
For those that are using older versions of RN, this totally works, thank you! |
Description
Hermes is enabled with following packaging options in android.
packagingOptions {
if (enableHermes) {
// For Hermes, delete all the libjsc* files
exclude "/libjsc*.so"
if (taskName.contains("Release")) {
// Reduce size by deleting the debugger/inspector
exclude '/libhermes-inspector.so'
exclude '/libhermes-executor-debug.so'
} else {
// Release libs take precedence and must be removed
// to allow debugging
exclude '/libhermes-executor-release.so'
}
} else {
// For JSC, delete all the libhermes* files
exclude "**/libhermes*.so"
}
}
Version
0.66.0
Output of
npx react-native info
Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes-executor-release.so caused by: couldn't find DSO to load: libreactnativejni.so caused by: ELF file truncated result: 0 result: 0
at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:918)
at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:740)
at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:654)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:634)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:582)
at com.facebook.hermes.reactexecutor.HermesExecutor.(HermesExecutor.java:25)
at com.facebook.hermes.reactexecutor.HermesExecutorFactory.create(HermesExecutorFactory.java:29)
at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1066)
at java.lang.Thread.run(Thread.java:923)
Steps to reproduce
N/A
Snack, code example, screenshot, or link to a repository
No response
The text was updated successfully, but these errors were encountered: