David Peters
David Peters

Reputation: 1

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'on facebook accesstoken.class

I have been having some issues with this for a while

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/facebook/AccessToken$1.class

I do not know what to do, please help.

this is my build gradle

apply plugin: 'com.android.application'

android { compileSdkVersion 23 buildToolsVersion "23"

aaptOptions {
    useNewCruncher false
}

defaultConfig {
    applicationId "com.example.dell.treblemusic"
    minSdkVersion 15
    targetSdkVersion 24
    versionCode 1
    versionName "1.0.1"
    multiDexEnabled true
}
buildTypes {
    release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}



packagingOptions {
    exclude 'META-INF/DEPENDENCIES.txt'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/notice.txt'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/dependencies.txt'
    exclude 'META-INF/LGPL2.1'
}
lintOptions {
    abortOnError false
}

dexOptions {
    incremental true
}

}

dependencies { // compile fileTree(include: ['*.jar'], dir: 'libs') testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.1.1' compile files('libs/clink210.jar') compile files('libs/eventbus-2.4.0.jar') compile files('libs/picasso-2.5.2.jar') compile project(':PayPalAndroidSDK-2.12.4') compile 'com.google.android.gms:play-services-wallet:8.4.0' compile 'com.stripe:stripe-android:1.0.0' compile 'com.squareup.retrofit:retrofit:1.9.0' compile 'com.android.support:recyclerview-v7:22.2.0' compile 'com.stripe:stripe-java:1.37.1' compile 'com.android.support:multidex:1.0.1' compile project(':VisaCheckout-Android-SDK-2.9') compile files('libs/card-io-5.1.1.jar') compile files('libs/android-volley-1.0.10.jar') compile 'com.pnikosis:materialish-progress:1.0' compile files('libs/httpclient-4.2.4.jar') compile files('libs/apache-httpcomponents-httpcore.jar') compile files('libs/guava-13.0.1.jar') compile project (':facebook-android-sdk-4.10.0') compile 'com.android.support:cardview-v7:22.2.1' }

Upvotes: 0

Views: 366

Answers (2)

Shiva Snape
Shiva Snape

Reputation: 544

If You are using various Google play services like Location, Authentication etc, you should use same level of Libraries.

eg:

compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.android.gms:play-services-appindexing:10.0.1'

Upvotes: 0

kautilya hari
kautilya hari

Reputation: 213

You might be using different version of sample modules. Please follow these steps

  1. Add multidex in the gradle

    In the module app gradle

    android {
    ......
        defaultConfig {
        ....
        multiDexEnabled true
    }
    
  2. Added the dependency

    compile 'com.android.support:multidex:1.0.1'
    
  3. Add the facebook module and exclude dependent libraires

    compile('com.facebook.android:facebook-android-sdk:$faceBookVersion') {
         exclude group: 'com.android.support', module: 'multidex'
    }
    

Upvotes: 0

Related Questions