如果您的Studio是3.0.1,并且您的gradle使用的是3.0.1,如下
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
你并且设置了multiDexEnabled true依赖了这个implementation 'com.android.support:multidex:1.0.3' ,那么出现
Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
这个问题请您检查module.gradle内buildTypes release、debug里是否设置了debuggable true,如果没有请加上问题就解决了。
buildTypes {
release {
debuggable true // *****
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}