Skip to content
This repository has been archived by the owner on Oct 7, 2021. It is now read-only.

Execution failed for task ':app:mergeDebugNativeLibs' #227

Closed
abdes-zakari opened this issue Feb 3, 2021 · 5 comments
Closed

Execution failed for task ':app:mergeDebugNativeLibs' #227

abdes-zakari opened this issue Feb 3, 2021 · 5 comments

Comments

@abdes-zakari
Copy link

Version:

"react-native": "0.63.4",
"react-native-ffmpeg": "^0.5.1"

I want use the "full-gpl" package so i edited the build.gradle

image

After running: react-native run-android i got this error

Error

Execution failed for task ':app:mergeDebugNativeLibs'.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
More than one file was found with OS independent path 'lib/x86/libc++_shared.so'

image

How i can fix it ?

@Abdullah1428
Copy link

Your error is "More than one file was found with OS independent path 'lib/x86/libc++_shared.so'"

To fix this you have to write this code in android/app/build.gradle file

android {
    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'
    }
}

it is mentioned by @tanersener in the tips section to solve such an error.

after adding this rebuild your app and run 'react-native-run-android'.

@abdes-zakari
Copy link
Author

@Abdullah1428 thanks

@preetb123
Copy link

Open the project in Android Studio android and clean the project
Build -> Clean Project

@shahanshah87
Copy link

Your error is "More than one file was found with OS independent path 'lib/x86/libc++_shared.so'"

To fix this you have to write this code in android/app/build.gradle file

android {
    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'
    }
}

it is mentioned by @tanersener in the tips section to solve such an error.

after adding this rebuild your app and run 'react-native-run-android'.

Sorry for stupid question
But can you be more specific where to add this code in android/app/build.gradle. As I am still getting this error.

@hardik-wts
Copy link

Under the android {
}

I am paste that code where android start

android {
    
    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'
    }
  ...Other existing code
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants