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

Crashing on android when newArchEnabled=true with RN 0.77.1 #3410

Closed
jagnesh opened this issue Feb 15, 2025 · 9 comments · Fixed by #3412
Closed

Crashing on android when newArchEnabled=true with RN 0.77.1 #3410

jagnesh opened this issue Feb 15, 2025 · 9 comments · Fixed by #3412
Labels
Platform: Android This issue is specific to Android Repro provided A reproduction with a snack or repo is provided

Comments

@jagnesh
Copy link

jagnesh commented Feb 15, 2025

Description

I am using the below version of the library, which is causing issues on Android. The app crashes when launched. After struggling for some time, I found that it does not work with newArchEnabled.

"dependencies": {
"react": "18.3.1",
"react-native": "0.77.1",
"react-native-gesture-handler": "^2.23.1"
},

Error:

couldn't find DSO to load: libgesturehandler.so

Steps to reproduce

install the lib and just wrap view with

Snack or a link to a repository

https://github.com/jagnesh/SampleAppGestureHandler

Gesture Handler version

2.23.1

React Native version

0.77.1

Platforms

Android

JavaScript runtime

None

Workflow

None

Architecture

Fabric (New Architecture)

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

@github-actions github-actions bot added Platform: Android This issue is specific to Android Repro provided A reproduction with a snack or repo is provided labels Feb 15, 2025
@m-bert
Copy link
Contributor

m-bert commented Feb 17, 2025

Hi @jagnesh! I've just tested your repro and it works fine. Have you tried clearing caches?

react-native start --reset-cache
cd android && ./gradlew clean

@jagnesh
Copy link
Author

jagnesh commented Feb 17, 2025

Hi @m-bert,
Yeah, I tried after clearing caches as well and still getting the same issue.

@m-bert
Copy link
Contributor

m-bert commented Feb 17, 2025

Does it happen also on newly created app, or only in your existing project?

@jagnesh
Copy link
Author

jagnesh commented Feb 17, 2025

it's a newly created app only with a single lib. https://github.com/jagnesh/SampleAppGestureHandler

using yarn android cmd to run app

Logcat

FATAL EXCEPTION: mqt_v_js
                                                                                                                                       Process: com.sampleappgesturehandler, PID: 20194
                                                                                                                                       com.facebook.soloader.SoLoaderDSONotFoundError: couldn't find DSO to load: libgesturehandler.so
                                                                                                                                       	existing SO sources: 
                                                                                                                                       		SoSource 0: ApplicationSoSource[DirectorySoSource[root = /data/app/~~CzSch7x8QOfZZ6C47s0Zcw==/com.sampleappgesturehandler-3ZzH5lak7kvPcGMIL-jQYA==/lib/x86_64 flags = 0]]
                                                                                                                                       		SoSource 1: DirectApkSoSource[root = [/data/app/~~CzSch7x8QOfZZ6C47s0Zcw==/com.sampleappgesturehandler-3ZzH5lak7kvPcGMIL-jQYA==/base.apk!/lib/x86_64]]
                                                                                                                                       		SoSource 2: DirectorySoSource[root = /system/lib64 flags = 3]
                                                                                                                                       		SoSource 3: DirectorySoSource[root = /vendor/lib64 flags = 3]
                                                                                                                                       	Native lib dir: /data/app/~~CzSch7x8QOfZZ6C47s0Zcw==/com.sampleappgesturehandler-3ZzH5lak7kvPcGMIL-jQYA==/lib/x86_64
                                                                                                                                       
                                                                                                                                       	at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1216)
                                                                                                                                       	at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:1078)
                                                                                                                                       	at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:943)
                                                                                                                                       	at com.facebook.soloader.SoLoader.loadLibraryOnAndroid(SoLoader.java:859)
                                                                                                                                       	at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:842)
                                                                                                                                       	at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:812)
                                                                                                                                       	at com.swmansion.gesturehandler.react.RNGestureHandlerModule.install$lambda$2(RNGestureHandlerModule.kt:453)
                                                                                                                                       	at com.swmansion.gesturehandler.react.RNGestureHandlerModule.$r8$lambda$f7Xz9Y5eIjPZ1E__kihTPrMy1Lw(Unknown Source:0)
                                                                                                                                       	at com.swmansion.gesturehandler.react.RNGestureHandlerModule$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)
                                                                                                                                       	at android.os.Handler.handleCallback(Handler.java:959)
                                                                                                                                       	at android.os.Handler.dispatchMessage(Handler.java:100)
                                                                                                                                       	at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
                                                                                                                                       	at android.os.Looper.loopOnce(Looper.java:232)
                                                                                                                                       	at android.os.Looper.loop(Looper.java:317)
                                                                                                                                       	at com.facebook.react.bridge.queue.MessageQueueThreadImpl.lambda$startNewBackgroundThread$2(MessageQueueThreadImpl.java:217)
                                                                                                                                       	at com.facebook.react.bridge.queue.MessageQueueThreadImpl$$ExternalSyntheticLambda1.run(D8$$SyntheticClass:0)
                                                                                                                                       	at java.lang.Thread.run(Thread.java:1012)
---------------------------- PROCESS ENDED (20194) for package com.sampleappgesturehandler ----------------------------

@m-bert
Copy link
Contributor

m-bert commented Feb 17, 2025

Could you share output of find . -name libgesturehandler.so ran from root of the repository (after you build the app)?

@jagnesh
Copy link
Author

jagnesh commented Feb 17, 2025

I just observed one thing this crash is happening in AVD of Android 15.0 (16 KB Page Size Google APIs PlayStore). Will this be a matter of concern?

Image

Output

./node_modules/react-native-gesture-handler/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/armeabi-v7a/libgesturehandler.so
./node_modules/react-native-gesture-handler/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/x86/libgesturehandler.so
./node_modules/react-native-gesture-handler/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/arm64-v8a/libgesturehandler.so
./node_modules/react-native-gesture-handler/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/x86_64/libgesturehandler.so
./node_modules/react-native-gesture-handler/android/build/intermediates/cxx/Debug/492p6t4h/obj/armeabi-v7a/libgesturehandler.so
./node_modules/react-native-gesture-handler/android/build/intermediates/cxx/Debug/492p6t4h/obj/x86/libgesturehandler.so
./node_modules/react-native-gesture-handler/android/build/intermediates/cxx/Debug/492p6t4h/obj/arm64-v8a/libgesturehandler.so
./node_modules/react-native-gesture-handler/android/build/intermediates/cxx/Debug/492p6t4h/obj/x86_64/libgesturehandler.so
./node_modules/react-native-gesture-handler/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/armeabi-v7a/libgesturehandler.so
./node_modules/react-native-gesture-handler/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/x86/libgesturehandler.so
./node_modules/react-native-gesture-handler/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/arm64-v8a/libgesturehandler.so
./node_modules/react-native-gesture-handler/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/x86_64/libgesturehandler.so
./android/app/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/armeabi-v7a/libgesturehandler.so
./android/app/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/x86/libgesturehandler.so
./android/app/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/arm64-v8a/libgesturehandler.so
./android/app/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/x86_64/libgesturehandler.so
./android/app/build/intermediates/stripped_native_libs/debug/stripDebugDebugSymbols/out/lib/armeabi-v7a/libgesturehandler.so
./android/app/build/intermediates/stripped_native_libs/debug/stripDebugDebugSymbols/out/lib/x86/libgesturehandler.so
./android/app/build/intermediates/stripped_native_libs/debug/stripDebugDebugSymbols/out/lib/arm64-v8a/libgesturehandler.so
./android/app/build/intermediates/stripped_native_libs/debug/stripDebugDebugSymbols/out/lib/x86_64/libgesturehandler.so

@m-bert
Copy link
Contributor

m-bert commented Feb 17, 2025

Will this be a matter of concern?

Seems like it can, I was able to reproduce it on given version.

@m-bert
Copy link
Contributor

m-bert commented Feb 17, 2025

Could you please check if #3412 fixes this issue? 😅

@jagnesh
Copy link
Author

jagnesh commented Feb 17, 2025

It's working fine now. 🎉

node_modules/react-native-gesture-handler/android/build.gradle

            cmake {
                    cppFlags "-O2", "-frtti", "-fexceptions", "-Wall", "-Werror", "-std=c++20", "-DANDROID"
                    arguments "-DREACT_NATIVE_DIR=${REACT_NATIVE_DIR}",
                        "-DREACT_NATIVE_MINOR_VERSION=${REACT_NATIVE_MINOR_VERSION}",
                        "-DANDROID_STL=c++_shared",
                        "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON"
                    abiFilters (*reactNativeArchitectures())
                }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Android This issue is specific to Android Repro provided A reproduction with a snack or repo is provided
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants