Android Studio 3.0 执行任务失败:无法合并 dex [英] Android Studio 3.0 Execution failed for task: unable to merge dex

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

问题描述

android studio 在构建执行时遇到构建错误:

android studio was getting build error while build execution with following:

错误:任务:app:transformDexArchiveWithExternalLibsDexMergerForDebug"的执行失败.java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: 无法合并 dex"

Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'. java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex"

我的应用程序:build.gradle 文件:

My app:build.gradle file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion '26.0.2'
    defaultConfig {
        applicationId "com.pdroid.foodieschoice"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.firebaseui:firebase-ui-auth:2.3.0'

    testCompile 'junit:junit:4.12'
}
configurations.all {
    resolutionStrategy {
        force 'com.android.support:appcompat-v7:26.0.1'
        force 'com.android.support:support-compat:26.0.1'
        force 'com.android.support:support-core-ui:26.0.1'
        force 'com.android.support:support-annotations:26.0.1'
        force 'com.android.support:recyclerview-v7:26.0.1'
    }
}

apply plugin: 'com.google.gms.google-services'

任何解决方案

我已经通过 firebase github 站点完成了示例并解决了

i have done with sample through firebase github site and solved

推荐答案

对于基于 Cordova 的项目,在再次构建之前运行 cordova clean android,如 @mkimmet 建议.

For Cordova based project, run cordova clean android before build again, as @mkimmet suggested.

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

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