Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK org/bytedeco/javacpp/macosx-x86_64/libusb-1.0.dylib
File1: .gradle\caches\modules-2\files-2.1\org.bytedeco.javacpp-presets\libdc1394\2.2.4-1.3\f1498dacc46162ab68faeb8d66cf02b96fe41c61\libdc1394-2.2.4-1.3-macosx-x86_64.jar
File2: .gradle\caches\modules-2\files-2.1\org.bytedeco.javacpp-presets\libfreenect\0.5.3-1.3\736d65a3ef042258429d8e7742128c411806b432\libfreenect-0.5.3-1.3-macosx-x86_64.jar
Is this the right way to do it or some other approach is advisable?
Duplicate of #353
Successful solution for Duplicate files exception as below. MUST use the correct duplicateFileException file name 'org/bytedeco/javacpp/macosx-x86_64/libusb-1.0.dylib'.
packagingOptions {
pickFirst 'org/bytedeco/javacpp/macosx-x86_64/libusb-1.0.dylib'
/exclude 'META-INF/services/javax.annotation.processing.Processor'
pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/opencv/pom.properties'
pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/opencv/pom.xml'
pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/ffmpeg/pom.properties'
pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/ffmpeg/pom.xml'/
}
My exception before solved as below:
Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK org/bytedeco/javacpp/macosx-x86_64/libusb-1.0.dylib
File1: C:\Users\luoqg.gradle\caches\modules-2\files-2.1\org.bytedeco.javacpp-presets\libdc1394\2.2.4-1.3\f1498dacc46162ab68faeb8d66cf02b96fe41c61\libdc1394-2.2.4-1.3-macosx-x86_64.jar
File2: C:\Users\luoqg.gradle\caches\modules-2\files-2.1\org.bytedeco.javacpp-presets\libfreenect\0.5.3-1.3\736d65a3ef042258429d8e7742128c411806b432\libfreenect-0.5.3-1.3-macosx-x86_64.jar
Use the following code block
android {
packagingOptions {
pickFirst 'protobuf.meta'
}
}
Where do I put this code?
android {
packagingOptions {
pickFirst 'protobuf.meta'
}
}
@victorgomez95
in your app.gradle file add the above code
Most helpful comment
Successful solution for Duplicate files exception as below. MUST use the correct duplicateFileException file name 'org/bytedeco/javacpp/macosx-x86_64/libusb-1.0.dylib'.
packagingOptions {
pickFirst 'org/bytedeco/javacpp/macosx-x86_64/libusb-1.0.dylib'
/exclude 'META-INF/services/javax.annotation.processing.Processor'
pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/opencv/pom.properties'
pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/opencv/pom.xml'
pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/ffmpeg/pom.properties'
pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/ffmpeg/pom.xml'/
}
My exception before solved as below:
Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK org/bytedeco/javacpp/macosx-x86_64/libusb-1.0.dylib
File1: C:\Users\luoqg.gradle\caches\modules-2\files-2.1\org.bytedeco.javacpp-presets\libdc1394\2.2.4-1.3\f1498dacc46162ab68faeb8d66cf02b96fe41c61\libdc1394-2.2.4-1.3-macosx-x86_64.jar
File2: C:\Users\luoqg.gradle\caches\modules-2\files-2.1\org.bytedeco.javacpp-presets\libfreenect\0.5.3-1.3\736d65a3ef042258429d8e7742128c411806b432\libfreenect-0.5.3-1.3-macosx-x86_64.jar