Java 解析SDK时出现Android Gradle生成错误

Java 解析SDK时出现Android Gradle生成错误,java,android,parse-platform,gradle,android-gradle-plugin,Java,Android,Parse Platform,Gradle,Android Gradle Plugin,我正在尝试将Parse SDK库添加到我的android构建中,但在尝试运行我的项目时收到以下错误: 错误:任务的执行失败 “:app:transformClassesWithJarMergingForDebug”。> com.android.build.api.transform.TransformException: java.util.zip.ZipException:重复条目: com/parse/AbstractQueryController$1.class 我已尝试启用multiDe

我正在尝试将Parse SDK库添加到我的android构建中,但在尝试运行我的项目时收到以下错误:

错误:任务的执行失败 “:app:transformClassesWithJarMergingForDebug”。> com.android.build.api.transform.TransformException: java.util.zip.ZipException:重复条目: com/parse/AbstractQueryController$1.class

我已尝试启用multiDex,但没有成功

我的gradle构建如下所示:

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'
}
你的问题取决于

  compile 'com.parse:parse-android:1.12.0'
此库具有with
com.parse.bolts:bolts任务:1.3.0
,而
com.parse.bolts:bolts android:1.4.0
具有with
com.parse.bolts:bolts任务:1.4.0

这意味着您包含相同的库,但版本不同

使用:


编译'com.parse.bolts:bolts任务:1.4.0'

的可能副本
compile ('com.parse:parse-android:1.12.0'){
     exclude group: 'com.parse.bolts', module: 'bolts-tasks';
}