com.android.builder.dexing.DexArchiveMergerException:无法合并dex-Android Studio 3.0稳定 [英] com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex - Android Studio 3.0 stable

查看:142
本文介绍了com.android.builder.dexing.DexArchiveMergerException:无法合并dex-Android Studio 3.0稳定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了:

  • 在设置"->"Android SDK"->"SDK工具"中,已检查并安装了Google Play服务(v.46)
  • 已删除文件夹/.gradle
  • 清洁项目"
  • 重建项目

错误是:

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

项目build.gradle

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'

        classpath 'com.google.gms:google-services:3.1.0'
    }
}

allprojects {
    repositories {
        jcenter()
        google()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

App build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion '26.0.2'
    defaultConfig {
        applicationId "com.asanquran.mnaum.quranasaanurdutarjuma"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 3
        versionName "1.3"
        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:appcompat-v7:26.+'


    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.google.android.gms:play-services-ads:11.4.2'
    compile 'com.github.barteksc:android-pdf-viewer:2.3.0'
    compile 'org.apache.commons:commons-io:1.3.2'
    compile 'com.google.firebase:firebase-ads:11.4.2'
    compile 'com.google.firebase:firebase-messaging:11.4.2'
    compile 'com.google.firebase:firebase-storage:11.4.2'
    apply plugin: 'com.google.gms.google-services'
    testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

推荐答案

我认为这是由于Android Studio的最新版本(当时)造成的. 很久以后我尝试了一下,然后问题消失了.

I think it was due to Android Studio's latest version (at that time). I tried it after a long time then the issue gone.

这篇关于com.android.builder.dexing.DexArchiveMergerException:无法合并dex-Android Studio 3.0稳定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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