I'm running the gradle command: ./gradlew assembleRelease assembleAndroidTest and it is failing with the following error:
> Task :react-native-ffmpeg:mergeDebugAndroidTestNativeLibs FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-ffmpeg:mergeDebugAndroidTestNativeLibs'.
> 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'. If you are using jniLibs and CMake IMPORTED targets, see https://developer.android.com/studio/preview/features#automatic_packaging_of_prebuilt_dependencies_used_by_cmake
I followed the instructions here and added this code to my build.gradle:
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'
}
However, these packagingOptions don't seem to make any difference. I should note that running just assembleRelease works, it's only when I add in the assembleAndroidTest that there are problems. I have an issue open on the react-native-ffmpeg github, but this seems like a more general gradle/android issue which is why I'm posting here.