我在Android studio 3.0上即时运行DexArchiveBuilderException
。 Gradle构建正常,但尝试部署apk
时出错。
禁用即时运行可解决此问题。
如何通过即时运行实现这一目标?
完整错误:
Error:com.android.builder.dexing.DexArchiveBuilderException: Failed to process /Users/vedantagarwala/dunzo/cappuccino/android-final/demo/build/intermediates/transforms/instantRunSlicer/debug/9
//顶级构建文件:
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'
classpath 'com.github.dcendents:android-maven-plugin:1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
ext {
compileSdkVersion = 27
buildToolsVersion = "26.0.2"
targetSdkVersion = 22
minSdkVersion = 15
androidSupportLibVersion = "25.3.1"
googlePlayServiceVersion = "10.0.1";
resConfigs = ["en"];
// You can also create properties to specify versions for dependencies.
// Having consistent versions between modules can avoid conflicts with behavior.
}
我尝试过在线解决方案,例如升级/降级gradle和/或依赖项,但没有任何效果。
JDK:
$ java -version
openjdk version "1.8.0_152-release"
OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)
OpenJDK 64-Bit Server VM (build 25.152-b08, mixed mode)
答案 0 :(得分:2)
如果您的设备在MIUI上运行,请转到开发者设置 - >打开MIUI优化并将其关闭。然后你需要重启你的设备并重新编译代码。 即时运行应该重新启动并运行!