无法合并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 关注
- 542 浏览
添加回答
举报
0/150
提交
取消