When i used the gradle to build and run the apk, i get the error below::::
Error:Execution failed for task ':app:transformNative_libsWithMergeJniLibsForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK lib/armeabi-v7a/libgnustl_shared.so
File1:
app/build/intermediates/exploded-aar/com.facebook.react/react-native/0.20.1/jni
File2:
app/build/intermediates/exploded-aar/app/videosdk/unspecified/jni
Finally,i move one of the so file to assets,and load it manually before used
This works not very well , although it fixes the DuplicateFileException bug . If anyone get the better way pls tell me . Thanks!^_^
I was able to fix this by adding the code below to my
build.gradle
. It's kind of a hack; there should a more elegant fix, like not having to include the React Native version. Ideally React Native would resolve this. I opened an issue: https://github.com/facebook/react-native/issues/9454Cleaner solution is to explicitly tell Gradle that you know about the problem and accept any of these files. Depending on the architectures you support you may need only some of the. You can find details in documentation