1

I am trying to add the Parse SDK library to my android build but I receive the following error when I try to run my project:

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

I have tried enabling multiDex which has not worked.

My gradle build is as follows:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.green.philip.budgetplannerdroid"
        minSdkVersion 9
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

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:design:23.1.1'
    compile 'com.parse:parse-android:1.12.0'
    compile 'com.parse.bolts:bolts-android:1.4.0'
    compile 'com.android.support:multidex:1.0.1'
}
Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
P. G.
  • 82
  • 6
  • Possible duplicate of [Duplicate entry using Parse and Multidex](http://stackoverflow.com/questions/32140704/duplicate-entry-using-parse-and-multidex) – OneCricketeer Jan 18 '16 at 05:16

2 Answers2

1

Your issue depends by

  compile 'com.parse:parse-android:1.12.0'

This library has a dependency with com.parse.bolts:bolts-tasks:1.3.0 while com.parse.bolts:bolts-android:1.4.0 has a dependency with com.parse.bolts:bolts-tasks:1.4.0.
It means that you are including the same library but with different versions.

Use:

compile ('com.parse:parse-android:1.12.0'){
     exclude group: 'com.parse.bolts', module: 'bolts-tasks';
}
Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
1

compile 'com.parse.bolts:bolts-tasks:1.4.0'