来自库的运行时错误亲属,请告诉我解决方案

时间:2018-03-14 11:45:17

标签: android

请告诉我这个例外的原因是什么

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

  

java.lang.RuntimeException:java.lang.RuntimeException:com.android.builder.dexing.DexArchiveMergerException:无法合并dex *

    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.android.support:support-vector-drawable:26.1.0'
implementation 'com.google.firebase:firebase-database:11.0.4'
implementation 'com.google.firebase:firebase-storage:11.0.4'
implementation 'com.google.firebase:firebase-auth:11.0.4'
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 'io.paperdb:paperdb:2.6'
compile 'com.github.rey5137:material:1.2.4'
compile 'com.theartofdev.edmodo:android-image-cropper:2.6.+'
compile 'de.hdodenhof:circleimageview:2.2.0'

1 个答案:

答案 0 :(得分:0)

将此添加到defaultConfig

multiDexEnabled true

和依赖

compile 'com.android.support:multidex:1.0.1'

在Android标记

   defaultConfig {
        applicationId "com.test.app"
        minSdkVersion 19
        targetSdkVersion 27
        versionCode 4
        versionName "1.3"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true

    }

    dexOptions {
        javaMaxHeapSize "4g"
    }