android - 将android studio更新到3.0后任务执行失败

标签 android android-gradle-plugin android-studio-3.0

当我更新 Android Studio 3.0 时,出现错误

unable to merge with dex.

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

然后我得到以下错误:

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]))

构建.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'    
}

最佳答案

尝试删除应用程序的构建文件夹,而不是清理-重建-运行您的项目。 如果不起作用,则执行 Invalidate Caches/Restart。

编码愉快!!

关于android - 将android studio更新到3.0后任务执行失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47069903/

相关文章:

java - 将对象数组发送到 WebService

android - 如何将日期构建附加到 gradle 上的 versionNameSuffix

java - gradlew appengineEndpointsInstallClientLibs 有错误 Execution failed for task ':compileJava' 。 > 无效源版本 : 1. 7

android - 错误 : expected color but got (raw string) color/gray

android - Ubuntu 18.04 React Native 运行 Android javax.net.ssl.SSLException

java - Android 在第一个 Activity 开始时显示软键盘?

xml - Android 扩展 View 并从 XML 空指针异常创建

gradle - 在运行时动态添加gradle项目

android - 无法解决 ':app@debug/compileClasspath' : Could not resolve 的依赖关系

android - 错误 : Ambiguous method call. AppCompactActivity 和 Activity 中的 findViewById (int)