简体   繁体   中英

Android Gradle Build Error With Parse SDK

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'
}

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';
}

编译'com.parse.bolts:bolts-tasks:1.4.0'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM