将Android Studio更新为3.0后,执行任务失败 [英] Execution failed for task after updating android studio to 3.0

查看:152
本文介绍了将Android Studio更新为3.0后,执行任务失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新Android Studio 3.0时出现错误

When I updated my Android Studio 3.0, I get an error

unable to merge with dex.

然后我添加了mutiDexEnabled true,还在build.gradle中也添加了com.android.support:multidex:1.0.1.

Then I added mutiDexEnabled true and also added com.android.support:multidex:1.0.1 in build.gradle.

然后我收到以下错误:

错误:任务':app:transformClassesWithMultidexlistForDebug'的执行失败. java.io.IOException:无法编写[C:\ Users \ user \ AndroidStudioProjects \ KnightFox-IN BUDGET \ app \ build \ intermediates \ multi-dex \ debug \ componentClasses.jar](无法读取[C:\ Users \ user.gradle \ caches \ transforms-1 \ files-1.1 \ play-services-ads-lite-11.4.2.aar \ 9a54afd7907fee993ecc421b66ed4228 \ jars \ classes.jar(;;;;;; **.class)] (重复的zip条目[classes.jar:com/google/ads/mediation/MediationServerParameters $ Parameter.class]))

Error:Execution failed for task ':app:transformClassesWithMultidexlistForDebug'. java.io.IOException: Can't write [C:\Users\user\AndroidStudioProjects\KnightFox-IN BUDGET\app\build\intermediates\multi-dex\debug\componentClasses.jar] (Can't read [C:\Users\user.gradle\caches\transforms-1\files-1.1\play-services-ads-lite-11.4.2.aar\9a54afd7907fee993ecc421b66ed4228\jars\classes.jar(;;;;;;**.class)] (Duplicate zip entry [classes.jar:com/google/ads/mediation/MediationServerParameters$Parameter.class]))

build.gradle

build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion '26.0.2'

    defaultConfig {
        applicationId "com.copperseeds.android.kunjachamman.applicationin.budget"
        minSdkVersion 14
        targetSdkVersion 26
        multiDexEnabled true
    }


    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
        }
    }

}



dependencies {
    implementation files('libs/ksoap2-android-assembly-2.6.0-jar-with-dependencies.jar')
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    implementation 'com.android.support:appcompat-v7:26.0.0'
    implementation 'com.android.support:support-annotations:26.0.0'
    implementation 'com.android.support:support-v4:26.0.0'
    implementation 'com.github.navasmdc:MaterialDesign:1.5@aar'
    testImplementation 'junit:junit:4.12'
    implementation project(':ORMDroid')
    implementation project(':FacebookSDK')
    implementation project(':standOut')
    implementation files('libs/gcm.jar')
    implementation files('libs/google-play-services.jar')
    implementation 'com.google.android.gms:play-services:+'
    compile 'com.android.support:multidex:1.0.1'    
}

推荐答案

尝试这些步骤

步骤1:删除所有内部版本 .gradle 文件夹,

第2步:在您的 gradle.properties 中添加以下代码,

Step 2: Add the below code in your gradle.properties,

 android.enableAapt2=false

第3步:,然后同步您的android项目.

Step 3: Then Sync your android project.

这篇关于将Android Studio更新为3.0后,执行任务失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆