在app中为gradle构建错误

时间:2018-03-03 07:10:55

标签: java android gradle

错误:任务执行失败':app:transformClassesWithMultidexlistForDebug'。

  

java.io.IOException:无法写[G:\ new \ Schat \ app \ build \ intermediates \ multi-dex \ debug \ componentClasses.jar](无法读取[C:\ Users \ Dell。 gradle \ caches \ transforms-1 \ files-1.1 \ support-core-ui-27.1.0.aar \ 56bf57c0daa4e0ce1427f0af1690a5ff \ jars \ classes.jar(;;;;;; ** .class)](重复的zip条目[类]的.jar:机器人/支持/设计/插件/ CoordinatorLayout $ Behavior.class]))

Build.gradle 

apply plugin: 'com.android.application'

android {
compileSdkVersion 26
defaultConfig {
    applicationId "com.example.sushem.schat"
    minSdkVersion 15
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner 
    "android.support.test.runner.AndroidJUnitRunner"
    multiDexEnabled true


}
buildTypes {
    release {
        minifyEnabled true

        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.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'
compile 'com.google.firebase:firebase-messaging:11.8.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'
compile 'de.hdodenhof:circleimageview:2.2.0'
compile 'com.theartofdev.edmodo:android-image-cropper:2.6.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.squareup.okhttp:okhttp:2.5.0'
compile 'com.firebaseui:firebase-ui-database:3.2.2'
compile 'id.zelory:compressor:2.1.0'

compile 'com.android.support:multidex:1.0.2'


}

申请插件:'com.google.gms.google-services'

2 个答案:

答案 0 :(得分:0)

使用最新版本的支持库

implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support:design:27.1.0' 

答案 1 :(得分:0)

感谢大家的帮助。 问题在于依赖:

编译'com.theartofdev.edmodo:android-image-cropper:2.6.0'

所以我删除了它。