rive-app / rive-app/rive-react-native

Android: App fails to build

Open
#204 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
783
Forks
81
Avg merge
3d 6h
Merged PRs (30d)
3

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the package.json dependency versions and the Android build.gradle packaging configuration, then reproduce the mergeStagingDebugNativeLibs failure. Determine a dependency or packaging fix that avoids the reported runtime crash, and verify both the Android build and app runtime.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, react-native
Domain
build-system, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.