Android BuildGradle DuplicateFileException Build Error

So, I'm trying to include the Firebase SDK in android studio, and I completed the documentation for the email. Here is my error and Gradle File. Any help appreciated, thanks.

Error: execution failed for task ': app: transformResourcesWithMergeJavaResForDebug'. com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: duplicate files copied to the APK META-INF / maven / com.firebase / firebase-client-jvm / pom.properties File1: C : \ Users \ Owner \ AndroidStudioProjects \ RealChatHusk \ app \ libs \ firebase-client-android-2.5.2.jar File2: C: \ Users \ Owner.gradle \ caches \ modules-2 \ files-2.1 \ com.firebase \ firebase-client-jvm \ 2.5.2 \ 91731b8f5868a3e8a8a773f29b8d06b5c358f5bb \ firebase-client-jvm-2.5.2.jar

 apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { applicationId "com.example.owner.realchathusk" minSdkVersion 22 targetSdkVersion 23 versionCode 1 versionName "1.0" multiDexEnabled true } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } packagingOptions { exclude 'META-INF/LICENSE' exclude 'META-INF/LICENSE-FIREBASE.txt' exclude 'META-INF/NOTICE' } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:support-v4:23.1.1' compile 'com.android.support:design:23.1.1' compile 'com.firebase:firebase-client-android:2.5.2' } 
+5
source share
2 answers

try this code:

 compile 'com.android.support:appcompat-v7:23.2.0' compile 'com.android.support:support-v4:23.2.0' compile 'com.android.support:design:23.2.0' 
0
source

Add the text below to resolve the build.gradle file issue.

 packagingOptions { exclude 'jsr305_annotations/Jsr305_annotations.gwt.xml' exclude 'build-data.properties' } 

If you get more errors, a DuplicateFileException adds an exception file. For instance:

Error

 Duplicate files copied in APK jsr305_annotations/Jsr305_annotations.gwt.xml 

Decision

 exclude 'jsr305_annotations/Jsr305_annotations.gwt.xml' 
0
source

Source: https://habr.com/ru/post/1244474/


All Articles