【问题标题】:Build error for gradle in app应用程序中的 gradle 构建错误
【发布时间】:2018-08-11 09:50:52
【问题描述】:

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

java.io.IOException: Can't write [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'


}

应用插件:'com.google.gms.google-services'

【问题讨论】:

  • 发布你的 build.gradle
  • 我已经添加了 build.gradle

标签: java android gradle


【解决方案1】:

使用最新版本的支持库

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

【讨论】:

    【解决方案2】:

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

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

    所以我删除了它。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-10-03
    • 2021-02-09
    • 1970-01-01
    • 1970-01-01
    • 2017-11-09
    • 2015-10-02
    • 1970-01-01
    相关资源
    最近更新 更多