
我有Android Studio Beta.我创建了一个新项目,编译我的旧模块,但是当我尝试启动应用程序时,它没有启动消息:
Error:Execution Failed for task ':app:transformDexArchiveWithExternallibsDexMergerForDeBUG'.com.androID.builder.dexing.DexArchiveMergerException: Unable to merge 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 } productFlavors { }}dependencIEs { compile filetree(include: ['*.jar'], dir: 'libs') androIDTestCompile('com.androID.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.androID.support', module: 'support-annotations' }) //noinspection GradleCompatible compile 'com.androID.support:appcompat-v7:26.0.0-Alpha1' compile project(path: ':loginregistervIEw')}我的模块是gradle:
apply plugin: 'com.androID.library'apply plugin: 'realm-androID'androID { compileSdkVersion 26 buildToolsversion "26.0.1" defaultConfig { minSdkVersion 19 targetSdkVersion 26 versionCode 1 versionname "1.0" testInstrumentationRunner "androID.support.test.runner.AndroIDJUnitRunner" } buildTypes { release { MinifyEnabled false proguardfiles getDefaultProguardfile('proguard-androID.txt'), 'proguard-rules.pro' } }}dependencIEs { compile filetree(dir: 'libs', include: ['*.jar']) androIDTestCompile('com.androID.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.androID.support', module: 'support-annotations' }) compile 'com.androID.support:appcompat-v7:26.0.2' compile 'com.androID.support:support-v4:26.1.0' compile 'com.github.bumptech.glIDe:glIDe:4.0.0' testCompile 'junit:junit:4.12' compile project(path: ':parser')}我的第二个模块:
apply plugin: 'com.androID.library'apply plugin: 'realm-androID'androID { compileSdkVersion 26 buildToolsversion "26.0.1" defaultConfig { minSdkVersion 14 targetSdkVersion 23 versionCode 1 versionname "1.0" testInstrumentationRunner "androID.support.test.runner.AndroIDJUnitRunner" } realm { syncEnabled = true } uselibrary 'org.apache.http.legacy' buildTypes { release { MinifyEnabled false proguardfiles getDefaultProguardfile('proguard-androID.txt'), 'proguard-rules.pro' } } productFlavors { }}dependencIEs { compile filetree(dir: 'libs', include: ['*.jar']) androIDTestCompile 'junit:junit:4.12' // compile 'com.androID.support:appcompat-v7:23.1.0' // compile 'com.fasterxml.jackson.core:jackson-core:2.9.0' // compile 'com.fasterxml.jackson.core:jackson-annotations:2.9.0' // compile 'com.fasterxml.jackson.core:jackson-databind:2.9.0' compile 'com.Google.code.gson:gson:2.6.2'}____________finding_________
当我没有导入第二个模块(解析器)时,应用程序没有在dex上崩溃,但是当模块未导入时,应用程序无效. :D:D
解决方法:
当我从com.Google.androID.gms:play-services:11.2.2更新到com.Google.androID.gms:play-services:11.4.0时,我遇到了同样的问题.这解决了我:
>干净
>重建
以上是内存溢出为你收集整理的android – 无法合并dex全部内容,希望文章能够帮你解决android – 无法合并dex所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)