I am working with react native and every time I build a new project it seems to work on my device , but whenever I try to restart it It is giving me 1 or more errors
<go to android/app/build.grad
android {
...
+ packagingOptions {
+ pickFirst '**/libjsc.so'
+ pickFirst 'lib/x86/libc++_shared.so'
+ pickFirst 'lib/x86_64/libjsc.so'
+ pickFirst 'lib/arm64-v8a/libjsc.so'
+ pickFirst 'lib/arm64-v8a/libc++_shared.so'
+ pickFirst 'lib/x86_64/libc++_shared.so'
+ pickFirst 'lib/armeabi-v7a/libc++_shared.so'
+ }
}
Running the cleaning task solved the problem for me. In your project's android dir, run gradle wrapper with 'clean'
cd android && ./gradlew clean
Then you can go back to project dir and try running again.
cd .. && react-native run-android
go to android/app/build.gradle add the following under android
android {
...
+ packagingOptions {
+ pickFirst '**/libjsc.so'
+ pickFirst 'lib/x86/libc++_shared.so'
+ pickFirst 'lib/x86_64/libjsc.so'
+ pickFirst 'lib/arm64-v8a/libjsc.so'
+ pickFirst 'lib/arm64-v8a/libc++_shared.so'
+ pickFirst 'lib/x86_64/libc++_shared.so'
+ pickFirst 'lib/armeabi-v7a/libc++_shared.so'
+ }
}
Running the cleaning task solved the problem for me. In your project's android dir, run gradle wrapper with 'clean'
cd android && ./gradlew clean
Then you can go back to project dir and try running again.
cd .. && react-native run-android
Go to android/app/build.gradle and add the following thing under android:
android {
packagingOptions {
pickFirst '**/libjsc.so'
}
}
Then run it again. If your using react native i suggest you to close npm console and run it again.
in my case in react-native app this error was beacause of rn-fetch-blob v0.12.0,
and it makes release apk crash too
i do this:
npm uninstall rn-fetch-blob
npm i rn-fetch-blob@0.11.2
cd android && gradlew clean
cd..
react-native run-android
hope this help somebody <3
AAR libraries were not linking to the Main application from Bridge Project.
Solution:
implementation files(‘libs/sdk-5.0.0.aar’)
Instead of
implementation(name:'sdk-5.0.0', ext:'aar')
I faced another issue related to AAR file import into the android project. https://stackoverflow.com/a/58602329/3197778