Closed michalgrzegor closed 2 years ago
I am facing a similar issue. I upgraded my app to 0.68.2 RN and got the same error.
oh, I'm so glad we're not the only ones!
Also glad to have company!
We have the same java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libjscexecutor.so
error on multiple machines.
I have found that the issue with libjscexecutor.so
only causes an error and a crash when Detox is trying to open the app on the AVD (i.e. (device.launchApp()
):
yarn react-native run-android
(i.e. a standard Debug build, not with Detox), I also see the same libjscexecutor.so
message in adb logcat
, but it does not show as an error and does not cause the app to crash.I unfortunately don't have any suggestions for a fix, but happy to try anything that the Detox team might recommend and report back. It would definitely be nice to get our tests running locally again!
The Detox crash:
detox build --configuration android.emu.debug && detox test --configuration android.emu.debug
adb logcat
output shows the java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libjscexecutor.so
error that @michalgrzegor reported. See my adb logcat - detox.txt
And then:
detox test --configuration android.emu.debug
again, and cancel the script after it loads the .apk
onto the AVD, or manually drop the .apk
into the AVD.adb logcat
for this manual launch, I can see that the same libjscexecutor.so not found
message is shown, but it doesn't seem to cause a crash. See adb logcat - manual.txt
and:07-16 17:16:55.753 7442 7442 D SoLoader: libjscexecutor.so not found on /data/app/~~R_UhU_1E1n0LFIT1zQeYTQ==/com.helloworld.redactedappname.debug-5imjrLF19cwQO_5Hhif2dA==/lib/x86_64
07-16 17:16:55.753 7442 7442 D SoLoader: libjscexecutor.so not found on /data/app/~~R_UhU_1E1n0LFIT1zQeYTQ==/com.helloworld.redactedappname.debug-5imjrLF19cwQO_5Hhif2dA==/base.apk!/lib/x86_64
07-16 17:16:55.753 7442 7442 D SoLoader: libjscexecutor.so not found on /system/lib64
07-16 17:16:55.753 7442 7442 D SoLoader: libjscexecutor.so not found on /vendor/lib64
07-16 17:16:55.755 7442 7442 E SoLoader: couldn't find DSO to load: libjscexecutor.so
07-16 17:16:55.755 7442 7442 E SoLoader: SoSource 0: com.facebook.soloader.DirectorySoSource[root = /data/app/~~R_UhU_1E1n0LFIT1zQeYTQ==/com.helloworld.redactedappname.debug-5imjrLF19cwQO_5Hhif2dA==/lib/x86_64 flags = 0]
07-16 17:16:55.755 7442 7442 E SoLoader: SoSource 1: com.facebook.soloader.DirectApkSoSource[root = /data/app/~~R_UhU_1E1n0LFIT1zQeYTQ==/com.helloworld.redactedappname.debug-5imjrLF19cwQO_5Hhif2dA==/base.apk!/lib/x86_64]
07-16 17:16:55.755 7442 7442 E SoLoader: SoSource 2: com.facebook.soloader.DirectorySoSource[root = /system/lib64 flags = 2]
07-16 17:16:55.755 7442 7442 E SoLoader: SoSource 3: com.facebook.soloader.DirectorySoSource[root = /vendor/lib64 flags = 2]
07-16 17:16:55.755 7442 7442 E SoLoader: Native lib dir: /data/app/~~R_UhU_1E1n0LFIT1zQeYTQ==/com.helloworld.redactedappname.debug-5imjrLF19cwQO_5Hhif2dA==/lib/x86_64
07-16 17:16:55.755 7442 7442 E SoLoader: result: 0
I've tried this in a bunch of different environments and versions of RN. While it's possible that I might have gotten a stale cache at some point, with all of these permutations, I definitely see the libjscexecutor.so
crash issue on both RN 0.67.4 and 0.69.1.
system-images;android-30;default;x86_64
system-images;android-29;default;x86
Downgrading soloader to 0.10.1 fixed this for me. However I have an entirely separate set of problems which is that Detox android is far too slow to accomplish a test #3486
Downgrading soloader to 0.10.1 fixed this for me. However I have an entirely separate set of problems which is that Detox android is far too slow to accomplish a test #3486
This didn't do a trick for me, I still have the same error. What I've done:
apply from: "../../node_modules/react-native/react.gradle"
@@ -207,6 +208,8 @@ android {
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
//noinspection GradleDynamicVersion
I still have exact same error. @shamilovtim have you done anything additional to what I listed above?
How strange. One of the first things I had tried last week was forcing Soloader to 0.10.3
, but it didn't seem to fix the issue.
However, forcing it to 0.10.4
solves the problem for me (see releases):
In my android/app/build.gradle
:
dependencies {
...
implementation 'com.facebook.soloader:soloader:0.10.4+'
....
}
There seem to be several complaints in the Soloader project, regarding this error appearing in 64-bit environments. I'm guessing all of us are using "system-images;android-30;default;x86_64"
or similar for our AVDs?
@hanno-jonlay I thought that too for a minute. But already tried in several images.
All of them log the same error:
java.lang.UnsatisfiedLinkError: dlopen failed: library "/data/app/~~wWw63Xw3XuHckpe9HIzkGw==/com.myapp.test-eHV-I7_1b6vVx-wOOBZiRA==/base.apk!/lib/x86/libhermes.so" not found
I'm curious about the com.myapp.test ".test" information. That gives me an impression that the problem is coming from the test build used by detox.
How strange. One of the first things I had tried last week was forcing Soloader to
0.10.3
, but it didn't seem to fix the issue.However, forcing it to
0.10.4
solves the problem for me (see releases):In my
android/app/build.gradle
:dependencies { ... implementation 'com.facebook.soloader:soloader:0.10.4+' .... }
There seem to be several complaints in the Soloader project, regarding this error appearing in 64-bit environments. I'm guessing all of us are using
"system-images;android-30;default;x86_64"
or similar for our AVDs?
Tried the soloader 0.10.4, and that changed the logcat a little. Now I can see a new error:
But I honestly don't know if this error is relevant or just a consequence of changing the soloader version.
I'm guessing all of us are using "system-images;android-30;default;x86_64" or similar for our AVDs?
That's exactly what we're using.
That gives me an impression that the problem is coming from the test build used by detox.
I also think it's caused by detox somehow. As Michał mentioned in description, the apk built with assembleRelease
works fine. It's only the apk built with assembleAndroidTest -DtestBuildType=debug
that fails.
I'm in the same boat as you - same problem
Same, can't run detox against an android release build with hermes enabled.
That's a hunch, but I'm starting to suspect this line: https://github.com/facebook/react-native/blob/b66db7a84093b0da9b619b1e187c2c812b16893e/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt#L228
I actually don't know kotlin or gradle, but what I think I'm looking at is a mechanism that removes from the bundle all files that match glob */libjsc.so. The error would be caused by the fact that normal app doesnt need libjsc but Detox test needs it.
I've tried commenitng out this line in node_modules and rebuilding the app, but I can't see to get it to use my modified code. Perhaps someone in this thread is more knowledgable and can confirm/disprove my conjecture.
Unfortunately I don't think I can share much more on our end, as we now have this working in both RN 0.69.1 and 0.67.4 with the Soloader version pinning.
However, @kowalski - the link you've just posted reminds me of something I also stumbled across in earlier debugging here.
Specifically https://github.com/facebook/react-native/issues/25537#issuecomment-1104619909, which suggests setting the enableVmCleanup: false
property in the android/app/build.gradle
:
project.ext.react = [
enableHermes: true,
enableVmCleanup: false,
]
This was one of the first things I tried in our environment, but it didn't seem to have much effect at the time, so I ended up reverting it.
Perhaps you'll have more luck? It may be a better option than trying to patch node_modules
directly.
One last addition from me.
We're upgrading a couple of RN projects at the moment and have stumbled across a lot of discussion about Soloader 0.10.3 causing issues in Android instrumented tests:
Good luck to all of you!
Thanks @hanno-jonlay. None of the pointers resolved the issue for me, but I appreciate the effort.
I will wait for Expo 46 and hope that RN69 (with bundled Hermes) fixes the issue.
we now have this working in both RN 0.69.1 and 0.67.4 with the Soloader version pinning.
@hanno-jonlay do I understand correctly that it works fine for you on 0.69.1? What exact version of Soloader have you pinned to?
...
Tried the soloader 0.10.4, and that changed the logcat a little. Now I can see a new error:
But I honestly don't know if this error is relevant or just a consequence of changing the soloader version.
Firstly i tried just to use specific version of soloader (0.10.4+) , and that alone didn't work for detox test build, because it was causing another error. Which, later, I solved by doing the following guide: https://wix.github.io/Detox/docs/introduction/android/#setting-detox-up-as-a-compiling-dependency
Thank you all
@hanno-jonlay do I understand correctly that it works fine for you on 0.69.1? What exact version of Soloader have you pinned to?
@kowalski - Yes - I'm pinned to 0.10.4
in both RN versions, and it appears to be working.
fixing to implementation 'com.facebook.soloader:soloader:0.10.4+'
fixed this for me
this issue symptoms was release version that didn't work in release move while working in debug , for traceability reasons
upgrading to 0.10.4 didn;t work
Same issue for me (using the soloader:0.10.4+
fix, with Detox 19.12.1 and RN 0.68.2). The weird thing is the tests don't run for me on an Intel chip (building the app in x86_64) but it works for my colleagues running the exact same test code and build on an M1 chip with arm64-v8a
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back.
Thank you for your contributions!
For more information on bots in this repository, read this discussion.
The issue has been closed for inactivity.
What happened?
After upgrading
react-native
to version0.68.2
from0.63.4
, the tests fail. The built application works. The error that is thrown by the tests is:By reading the more detailed logs, we find that the following command causes an error:
adb shell
output:These are logs from adb logcat. This is the error part.
logs:
``` 07-14 15:31:24.634 19982 19982 E SoLoader: couldn't find DSO to load: libhermes.so 07-14 15:31:24.634 19982 19982 E SoLoader: SoSource 0: com.facebook.soloader.DirectorySoSource[root = /data/app/~~uSoN9VPkk1WOrWDuOLHKBA==/com.revelator.originalworks-JByrEhVwC7zOOGW0bGmoXg==/lib/x86_64 flags = 0] 07-14 15:31:24.634 19982 19982 E SoLoader: SoSource 1: com.facebook.soloader.DirectApkSoSource[root = /data/app/~~_40r519kmaU-M2cpDflLfQ==/com.revelator.originalworks.test-iZJ33nB4_UiufyC2njdQTg==/base.apk!/lib/x86_64] 07-14 15:31:24.634 19982 19982 E SoLoader: SoSource 2: com.facebook.soloader.DirectorySoSource[root = /system/lib64 flags = 2] 07-14 15:31:24.634 19982 19982 E SoLoader: SoSource 3: com.facebook.soloader.DirectorySoSource[root = /vendor/lib64 flags = 2] 07-14 15:31:24.634 19982 19982 E SoLoader: Native lib dir: /data/app/~~uSoN9VPkk1WOrWDuOLHKBA==/com.revelator.originalworks-JByrEhVwC7zOOGW0bGmoXg==/lib/x86_64 07-14 15:31:24.634 19982 19982 E SoLoader: result: 0 07-14 15:31:24.635 19982 19982 W System.err: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so 07-14 15:31:24.635 19982 19982 W System.err: SoSource 0: com.facebook.soloader.DirectorySoSource[root = /data/app/~~uSoN9VPkk1WOrWDuOLHKBA==/com.revelator.originalworks-JByrEhVwC7zOOGW0bGmoXg==/lib/x86_64 flags = 0] 07-14 15:31:24.635 19982 19982 W System.err: SoSource 1: com.facebook.soloader.DirectApkSoSource[root = /data/app/~~_40r519kmaU-M2cpDflLfQ==/com.revelator.originalworks.test-iZJ33nB4_UiufyC2njdQTg==/base.apk!/lib/x86_64] 07-14 15:31:24.635 19982 19982 W System.err: SoSource 2: com.facebook.soloader.DirectorySoSource[root = /system/lib64 flags = 2] 07-14 15:31:24.635 19982 19982 W System.err: SoSource 3: com.facebook.soloader.DirectorySoSource[root = /vendor/lib64 flags = 2] 07-14 15:31:24.635 19982 19982 W System.err: Native lib dir: /data/app/~~uSoN9VPkk1WOrWDuOLHKBA==/com.revelator.originalworks-JByrEhVwC7zOOGW0bGmoXg==/lib/x86_64 07-14 15:31:24.635 19982 19982 W System.err: result: 0 07-14 15:31:24.635 19982 19982 W System.err: at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1098) 07-14 15:31:24.635 19982 19982 W System.err: at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:914) 07-14 15:31:24.635 19982 19982 W System.err: at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:826) 07-14 15:31:24.635 19982 19982 W System.err: at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:773) 07-14 15:31:24.635 19982 19982 W System.err: at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:743) 07-14 15:31:24.635 19982 19982 W System.err: at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:25) 07-14 15:31:24.635 19982 19982 W System.err: at com.facebook.hermes.reactexecutor.HermesExecutor.Setup
./android/build.gradle
: https://pastebin.com/raw/kFP9SvkV./android/app/build.gradle
: https://pastebin.com/raw/AdYvm1tCDetoxTest.java
: https://pastebin.com/raw/V8vZMt6EWhat was the expected behaviour?
No response
Was it tested on latest Detox?
Did your test throw out a timeout?
Help us reproduce this issue!
No response
In what environment did this happen?
Detox version: 19.6.9 React Native version: 0.68.2 Node version: 12.21 Device model: Nexus_5X_API_R Android version: 11 Test-runner (select one): jest+jasmine
Detox logs
https://pastebin.com/raw/2Z6s7bYj
Device logs
https://pastebin.com/raw/PHwrUEMY
More data, please!
No response