Closed RodolfoGS closed 2 years ago
hi there! the issue sounds like this one: https://stackoverflow.com/questions/28638809/android-ndk-unsatisfiedlinkerror-dlopen-failed-empty-missing-dt-hash i checked the v8's default minSdkVersion is 23, will try to build a v8-android with minSdkVersion=21. will update here once it's released. thanks!
@Kudo were you be able to test it on Android 5?
I couldn't because my Android Studio Simulator crash with that Android version (The emulator process for AVD has terminated), not related to v8, and I can't use Genymotion because it's not compatible with Apple M1
Finally I could reproduce the crash using Genymotion Cloud running a Samsung Galaxy S6 with Android 5.0, it's super easy to reproduce. Just create an APK release and run on Android 5. It crash at start.
I tested with react-native 0.68.2 since 0.69 fails to compile.
I created a repo to reproduce but just consist in create a new react-native project, configure v8, create apk release and run on Android 5.
Clone the repo: https://github.com/RodolfoGS/react-native-v8-crash/tree/main
Here are 2 branched (v8-enabled and v8-disabled)
According to this seems that the flag --hash-style=both
fixes the issue:
GNU hashes (Availible in API level >= 23)
The GNU hash style available with --hash-style=gnu allows faster symbol lookup and is now supported by the dynamic linker in API 23 and above. (Use --hash-style=both if you want to build code that uses this feature >= Android M but still works on older releases.)
Source 1: https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#gnu-hashes-availible-in-api-level-23 Source 2: https://stackoverflow.com/a/53806411/1687136
@Kudo do you know where I need to put that flag? (--hash-style=both
)
I tried putting in node_modules/react-native-v8/android/CMakeLists.txt
APP_LDFLAGS := -Wl,--build-id,--hash-style=both
But doesn't work, do you have any idea about this?
that's clever to use genymotion cloud. if that don't take too much time, could you help me to verify whether v8-android-*@next
, e.g. v8-android-jit@next fixes the crash issue? i'm not pretty sure if this change can fix the issue
Woow that worked!! Tested v8-android-nointl: 10.100.1
(next) and works perfectly on Android 5 (API 21)
awesome! thanks @RodolfoGS. everything looks good and i promoted 10.100.1 as latest. i am going to close this issue. if there's any other problems, please create a new issue for me. thanks!
I'm having a lot of errors in Crashlytics with the following stack trace, I don't know how to reproduce since in my device all works perfectly. This happens to some users in production and I noticed that all devices are in Android 5.
Devices affected:
I'm using: