构建APK时出现重复输入错误

时间:2016-05-18 13:14:34

标签: java android

我正在开发一个Android应用程序......但是当我尝试构建一个APK时,我得到了这个错误

  

错误:任务执行失败   ':应用程序:transformClassesWithJarMergingForRelease'。 >   com.android.build.api.transform.TransformException:   java.util.zip.ZipException:重复条目:   机器人/支撑/ V7 / util的/ AsyncListUtil $ DataCallback.class

我似乎找不到适合它的解决方案......这是我的应用级gradle构建

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.base29.alltimetoprecipes"
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    //Here the magic Begins
    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }
//Here the magic Ends
    productFlavors {
    }
    useLibrary 'org.apache.http.legacy'
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile fileTree(include: ['picasso-2.5.2.jar'], dir: 'libs')
    compile fileTree(include: ['httpmime-4.2.1.jar'], dir: 'libs')
    compile 'com.android.support:multidex:1.0.0'
    compile 'com.android.support:appcompat-v7:24.0.0-alpha1'
    compile 'com.android.support:design:24.0.0-alpha1'
    compile 'com.android.support:cardview-v7:24.0.0-alpha1'
    compile 'com.android.support:palette-v7:24.0.0-alpha1'
    compile 'com.android.support:recyclerview-v7:24.0.0-alpha1'
    compile 'com.google.android.gms:play-services:8.4.0'
    compile 'com.google.android.gms:play-services-ads:8.4.0'
    compile 'com.google.android.gms:play-services-identity:8.4.0'
    compile 'com.google.android.gms:play-services-gcm:8.4.0'

}

感谢您的帮助。谢谢

更新:

我已经更改了依赖项的版本......

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile fileTree(include: ['picasso-2.5.2.jar'], dir: 'libs')
    compile fileTree(include: ['httpmime-4.2.1.jar'], dir: 'libs')
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.android.support:design:23.4.0'
    compile 'com.android.support:cardview-v7:23.4.0'
    compile 'com.android.support:palette-v7:23.4.0'
    compile 'com.android.support:recyclerview-v7:23.4.0'
    compile 'com.google.android.gms:play-services:8.4.0'
    compile 'com.google.android.gms:play-services-ads:8.4.0'
    compile 'com.google.android.gms:play-services-identity:8.4.0'
    compile 'com.google.android.gms:play-services-gcm:8.4.0'

}

1 个答案:

答案 0 :(得分:0)

检查您的依赖项版本,您必须具有兼容的版本,特别注意com.google包,必须具有相同的版本,如:

compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.google.android.gms:play-services-ads:8.4.0'