無法合并Dex我有安卓工作室Beta。我創建了一個新項目,編譯了我的舊模塊,但是當我嘗試啟動應用程序時,它沒有帶著消息啟動:Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.com.android.builder.dexing.DexArchiveMergerException:無法合并dex但我不知道怎么解決這個錯誤。我在谷歌上搜索了幾個小時,但沒有成功。我的項目分級: // Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-beta6'
classpath "io.realm:realm-gradle-plugin:3.7.1"
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}}allprojects {
repositories {
jcenter()
google()
}}task clean(type: Delete) {
delete rootProject.buildDir}我的應用程序Gradle: apply plugin: 'com.android.application'android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "parad0x.sk.onlyforyou"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
}
}
compileOptions {
targetCompatibility 1.7
sourceCompatibility 1.7
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
lintOptions {
checkReleaseBuilds false
}當我沒有導入第二個模塊(解析器)時,應用程序沒有在Dex上崩潰,但是當模塊沒有被導入時,應用程序就不能工作了。*D:d
3 回答

DIEA
TA貢獻1820條經驗 獲得超2個贊
com.google.android.gms:play-services:11.2.2
com.google.android.gms:play-services:11.4.0
打掃,清除 重建

慕尼黑8549860
TA貢獻1818條經驗 獲得超11個贊
APP/build.gradle:
android { defaultConfig { multiDexEnabled true }}
- 3 回答
- 0 關注
- 569 瀏覽
添加回答
舉報
0/150
提交
取消