Android构建gradle失败,错误app:transformClassesWithMultidexlistForDebug'

时间:2018-03-05 04:39:29

标签: java android android-gradle build.gradle android-multidex

错误记录

  

错误:任务':app:transformClassesWithMultidexlistForDebug'执行失败。   java.io.IOException:无法写[D:\ Android \ testapp \ app \ build \ intermediates \ multi-dex \ debug \ componentClasses.jar](无法读取[C:\ Users \ Code] Nemesis.gradle \ caches \ transforms-1 \ files-1.1 \ support-core-ui-27.1.0.aar \ 5ded4fc43c89c2e4a62253c7f0400fc3 \ jars \ classes.jar(;;;;;; **。class)](重复的zip条目[classes.jar:机器人/支持/设计/插件/ CoordinatorLayout $ Behavior.class]))

摇篮

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.codenemesis.testapp"
        multiDexEnabled true
        minSdkVersion 18
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support:design:26.+'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.google.firebase:firebase-database:11.8.0'
    implementation 'com.google.firebase:firebase-auth:11.8.0'
    implementation 'com.google.firebase:firebase-storage:11.8.0'
    implementation 'com.google.android.gms:play-services-auth:11.8.0'
    implementation 'com.google.android.gms:play-services:11.8.0'
    implementation 'com.google.firebase:firebase-messaging:11.8.0'
    implementation 'com.android.support:recyclerview-v7:26.+'
    implementation 'com.android.support:cardview-v7:26.+'
    implementation 'com.firebaseui:firebase-ui-database:0.4.0'

    // Photo dependencies
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.+'
    implementation 'id.zelory:compressor:2.1.0'

    implementation 'com.android.support:support-v4:26.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}

apply plugin: 'com.google.gms.google-services'

已经尝试过:清洁和重建。

1 个答案:

答案 0 :(得分:2)

我发现gms:play-services:11.8.0support:appcompat-v7:26.1.0

有冲突

禁用任何一个都可以。

我建议使用特定的游戏服务模块。你可以在这里查看清单 https://developers.google.com/android/guides/setup

同样使用com.theartofdev.edmodo:android-image-cropper:2.5.1,因为2.6.0使用sdk v27