API 27问题-原因:java.lang.RuntimeException:com.android.builder.dexing.DexArchiveMergerException:合并dex归档时出错

时间:2018-09-03 19:22:27

标签: android dex

构建应用程序时出错。尝试了很多,但没有用。如何解决?非常感谢!

build.gradle中的某些设置如下

compileSdkVersion 27

minSdkVersion 21
targetSdkVersion 27

multiDexEnabled true

    dependencies {
        implementation fileTree(include: ['*.jar'], dir: 'libs')
        //noinspection GradleCompatible
        implementation 'com.android.support:appcompat-v7:27.1.1'
        implementation 'com.android.support:design:27.1.1'
        implementation 'com.android.support:support-v4:27.1.1'
        implementation 'com.android.support:recyclerview-v7:27.1.1'

        implementation 'com.android.support.constraint:constraint-layout:1.1.2'

        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'com.android.support.test:runner:1.0.2'
        androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

        implementation 'de.hdodenhof:circleimageview:2.2.0'
        implementation 'com.google.android.gms:play-services:12.0.1'
        implementation 'com.google.android.gms:play-services-ads:10.2.0'
        implementation 'com.google.android.gms:play-services-auth:10.2.0'
        implementation 'com.google.maps.android:android-maps-utils:0.3.+'

        implementation 'com.google.code.gson:gson:2.8.1'
    }

错误是

org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
Caused by: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
Caused by: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
Caused by: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives

0 个答案:

没有答案