rive-react-native icon indicating copy to clipboard operation
rive-react-native copied to clipboard

Android: App fails to build

Open MennatullahMohamed opened this issue 2 years ago • 1 comments

Description

App fails while building on android only. I've followed the document carefully and tried many solutions from the open issues here with no success

Package.json

"react": "17.0.2",
"react-native": "0.68.5",
"rive-react-native": "^6.0.4"

Failure

Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeStagingDebugNativeLibs'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeNativeLibsTask$MergeNativeLibsTaskWorkAction
   > 2 files found with path 'lib/arm64-v8a/libc++_shared.so' from inputs:
      - /Users/mennaibrahim/.gradle/caches/transforms-3/bbe72318b10c36ed25de961229d71538/transformed/jetified-react-native-0.68.5/jni/arm64-v8a/libc++_shared.so
      - /Users/mennaibrahim/.gradle/caches/transforms-3/cfec5debcfef80703ef16a8c0084d64d/transformed/jetified-rive-android-8.2.1/jni/arm64-v8a/libc++_shared.so
     If you are using jniLibs and CMake IMPORTED targets, see
     https://developer.android.com/r/tools/jniLibs-vs-imported-targets

I've seen this solution to add pickFirst options in build.gradle as shown below:

  packagingOptions {
        pickFirst 'lib/x86/libc++_shared.so'
        pickFirst 'lib/x86_64/libc++_shared.so'
        pickFirst 'lib/armeabi-v7a/libc++_shared.so'
        pickFirst 'lib/arm64-v8a/libc++_shared.so'
    }

the app build successfully but crashes on runtime

MennatullahMohamed avatar Sep 21 '23 14:09 MennatullahMohamed

same issues

hieuptit93 avatar Jun 17 '24 09:06 hieuptit93