com.android.builder.dexing.DexArchiveMergerException:无法合并dex

问题描述 投票:0回答:1

在Android Studio 3.6中]

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    ext.kotlin_version = '1.3.50'

    repositories {
        maven { url 'https://maven.fabric.io/public' }
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.2'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'io.fabric.tools:gradle:1.25.4'
        classpath "com.jaredsburrows:gradle-license-plugin:0.8.41"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

在app / build.gradle中:

android {
    compileSdkVersion 28

    defaultConfig {
        minSdkVersion 17
        targetSdkVersion 28
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
        vectorDrawables.useSupportLibrary = true
        manifestPlaceholders = [
                fabricApiKey: keystoreProperties['FabricApiKey'] != null
                        ? keystoreProperties['FabricApiKey']
                        : ""
        ]
        multiDexKeepFile file('multidex-keep.txt')
    }

但是在构建时出现错误:

> Task :app:transformClassesWithMultidexlistForDebug

> Task :app:mergeDexDebug FAILED
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:593)
    at java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:677)
    at java.util.concurrent.ForkJoinTask.join(ForkJoinTask.java:720)

在Android Studio 3.6中// //顶层构建文件,您可以在其中添加所有子项目/模块共有的配置选项。 buildscript {ext.kotlin_version ='1.3.50'存储库{...

android android-studio-3.0
1个回答
0
投票

更改为

© www.soinside.com 2019 - 2024. All rights reserved.