Closed justintoth closed 1 year ago
π @justintoth Thanks for opening your issue here! If you find this package useful hit the starπ!
@justintoth can you try this code in build.gralde
and check
android{
........
packagingOptions {
pickFirst 'lib/arm64-v8a/libcrypto.so'
}
}
@numandev1 Thanks for the quick reply! It didn't work, it still throws the same error if I add that in my android/app/build.gradle file. I also looked in my android/build.gradle file but it doesn't have an android section, so I assume the android/app file is the correct one.
Execution failed for task ':app:mergeDebugNativeLibs'.
A failure occurred while executing com.android.build.gradle.internal.tasks.MergeNativeLibsTask$MergeNativeLibsTaskWorkAction > 2 files found with path 'lib/armeabi-v7a/libcrypto.so' from inputs: - /Users/justintoth/Dev/m365-mobile-app/node_modules/react-native-keys/android/build/intermediates/library_jni/debug/jni/armeabi-v7a/libcrypto.so - /Users/justintoth/.gradle/caches/transforms-3/21df3bd3ae107d2ee802eb869f41fec9/transformed/jetified-flipper-0.182.0/jni/armeabi-v7a/libcrypto.so If you are using jniLibs and CMake IMPORTED targets, see https://developer.android.com/r/tools/jniLibs-vs-imported-targets
What does "fix" it is if I add libcrypto.so to the excludes in the android/build.gradle file in the react-native-keys node_modules folder.
packagingOptions {
excludes = ['**/libc++_shared.so',
'**/libfbjni.so',
'**/libreactnativejni.so',
'**/libjsi.so',
'**/libreact_nativemodule_core.so',
'**/libturbomodulejsijni.so',
'**/libcrypto.so'
]
}
I can permanently apply this by using patch-package, but it doesn't seem like a great solution.
@justintoth Actually, somehow two packages are compiling the same file, good approach is to use pickFirst
, you can connect with me on LinkedIn https://www.linkedin.com/in/numandev, we can see it on zoom session
Hey folks, did you managed to solve this? Thanks
@efstathiosntonas can you try this code in build.gralde
and check
android{
........
packagingOptions {
pickFirst '**/libcrypto.so'
}
}
@numandev1 that didn't work :/
stacktrace:
com.facebook.react.common.JavascriptException: Error: Exception in HostObject::get for prop 'Keys': java.lang.UnsatisfiedLinkError: dlopen failed: library "libcrypto.so" not found: needed by /data/app/~~kDSZuwRkmz7M6dR5GmEBnw==/com.XXXX-vYdc4DF9x4eWt9v_mxqDjw==/lib/arm64/libreact-native-keys.so in namespace clns-7, js engine: hermes, stack:
packagingOptions {
pickFirst "**/armeabi-v7a/libc++_shared.so"
pickFirst "**/x86/libc++_shared.so"
pickFirst "**/arm64-v8a/libc++_shared.so"
pickFirst "**/x86_64/libc++_shared.so"
pickFirst "**/x86/libjsc.so"
pickFirst "**/armeabi-v7a/libjsc.so"
pickFirst "**/libcrypto.so"
}
@efstathiosntonas can you comment this line from node_modules and check?
@numandev1 shall I keep the pickFirst "**/libcrypto.so"
on app/build.gradle
?
@efstathiosntonas you can remove pickFirst "**/libcrypto.so"
and comment that line from node_modules and check
@numandev1 I still get the issue :/
ps. on release
@efstathiosntonas can you connect with me on LinkedIn https://www.linkedin.com/in/numandev ?, we can see it on Zoom session, it is night-time in Pakistan, and going to sleep now,
the issue is some code is excluding libcrypto.so
file in our apk, which is required in for using this package
sure, let's talk tomorrow!
@numandev1 Hi, I upgraded to rn@0.74 and this error is back:
Error: Exception in HostObject::get for prop 'Keys': java.lang.UnsatisfiedLinkError: dlopen failed: library "libcrypto.so" not found: needed by /data/app/~~3zZNXhfiC-LaMn2O-GcCHQ==/com.XXXXX-MMetn9UteJY31KDgHH2bbw==/base.apk!/lib/arm64-v8a/libreact-native-keys.so in namespace clns-8, js engine: hermes
any ideas?
@numandev1 I have a feeling that since Flipper was removed entirely on react-native@0.74 it fails to find the libcrypto.so
, libcrypto
was used by Flipper so my guess is that libcrypto is never installed anymore somewhere during the build process.
Current behavior
When trying to build on Android, it's giving the error:
Expected behavior
It should build properly.
Platform
React Native Version
0.72.1