tanersener / react-native-ffmpeg

FFmpeg for react-native. Not maintained anymore. Superseded by FFmpegKit.
GNU General Public License v3.0
400 stars 51 forks source link

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

Closed abdes-zakari closed 3 years ago

abdes-zakari commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

@Abdullah1428 thanks

preetb123 commented 3 years ago

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

shahanshah87 commented 3 years ago

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 commented 3 years ago
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
}