5

So I'm trying to incorporate Firebase SDK in android studio and I followed the documentation to the letter. 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 in 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'
}
2
  • compile 'com.firebase:firebase-client-android:2.3.1' Then Clean-Rebuild Your Project. Commented Mar 5, 2016 at 6:35
  • Same error occurs after this fix Commented Mar 5, 2016 at 18:46

2 Answers 2

1

Add below text on build.gradle file solve problem

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

If getting more error DuplicateFileException add file with exclude. Like :

Error

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

Solution

exclude  'jsr305_annotations/Jsr305_annotations.gwt.xml'
Sign up to request clarification or add additional context in comments.

Comments

0

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'

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.