简体   繁体   English

在应用程式中建立Gradle的错误

[英]Build error for gradle in app

Error:Execution failed for task ':app:transformClassesWithMultidexlistForDebug'. 错误:任务':app:transformClassesWithMultidexlistForDebug'的执行失败。

java.io.IOException: Can't write [G:\\new\\Schat\\app\\build\\intermediates\\multi-dex\\debug\\componentClasses.jar] (Can't read [C:\\Users\\Dell.gradle\\caches\\transforms-1\\files-1.1\\support-core-ui-27.1.0.aar\\56bf57c0daa4e0ce1427f0af1690a5ff\\jars\\classes.jar(;;;;;;**.class)] (Duplicate zip entry [classes.jar:android/support/design/widget/CoordinatorLayout$Behavior.class])) 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条目[classes.jar: android / support / design / widget / 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'


}

apply plugin: 'com.google.gms.google-services' 应用插件:“ com.google.gms.google-services”

Use the last version of support library 使用最新版本的支持库

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

Thanks everyone for helping. 感谢大家的帮助。 The problem was with dependacy : 问题在于依赖性:

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

So i Removed it. 所以我删除了它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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