Android合并索引错误
错误:任务“:app:transformDexArchiveWithExternalLibsDexMergerForDebug”的执行失败 java.lang.RuntimeException:com.android.builder.dexing.DexArchiveMergerException:无法合并dexAndroid合并索引错误,android,merge,android-manifest,manifest,dex,Android,Merge,Android Manifest,Manifest,Dex,错误:任务“:app:transformDexArchiveWithExternalLibsDexMergerForDebug”的执行失败 java.lang.RuntimeException:com.android.builder.dexing.DexArchiveMergerException:无法合并dex 您好,我收到上述错误,请解决。在Gradle中尝试以下代码: android { defaultConfig { multiDexEnabled true
您好,我收到上述错误,请解决。在Gradle中尝试以下代码:
android {
defaultConfig {
multiDexEnabled true
}
}
在应用程序级渐变文件中添加以下代码
defaultConfig {
multiDexEnabled true
}
请在这里更新build.gradle。并在gadel文件中添加multidex enable。 安卓{ 编译DK22版 buildToolsVersion“23.0.0” } 依赖关系{ 编译'com.android.support:multidex:1.0.3' }`1)添加多索引启用的true,如下所述
android {
defaultConfig {
multiDexEnabled true
}
}
2) 添加依赖项
compile 'com.android.support:multidex:1.0.1'
3) 在应用程序类中调用下面的方法
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
希望它能帮助你 首先清理项目,然后构建项目 将multiDexEnabled true添加到您的build.gradle
android {
compileSdkVersion xx
defaultConfig {
...
minSdkVersion xx //make sure your minSDK greater than 14
targetSdkVersion xx
multiDexEnabled true
...
}
}
最后添加依赖性
compile 'com.android.support:multidex:1.0.1'
可能重复的EC工程师可以做Android开发者的工作..太棒了.工程师可以做任何事兄弟。。!
compile 'com.android.support:multidex:1.0.1'