所以我今天早上更新了我的android工作室到3.1.1然后去更改了一些代码并再次运行我的应用程序但是我一直在收到错误并且不确定如何修复它,我搜索了SO和谷歌,但是避风港&看到与此有关的任何事情。在尝试构建或运行应用程序时,我也尝试过清理和重建以及同样的错误。
org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':app:transformDexWithInstantRunDependenciesApkForDebug'.
Caused by: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':app:transformDexWithInstantRunDependenciesApkForDebug'
Caused by: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformDexWithInstantRunDependenciesApkForDebug'
Caused by: java.lang.RuntimeException: com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: Failed to execute aapt
Caused by: com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: Failed to execute aapt
Caused by: com.android.ide.common.process.ProcessException: Failed to execute aapt
Caused by: java.util.NoSuchElementException
答案 0 :(得分:8)
失败的任务是:
:app:transformDexWithInstantRunDependenciesApkForDebug
尝试关闭即时运行:
Settings
或Preferences
对话框:在Windows
或Linux
,
选择文件>菜单栏中的设置。在Mac OSX上,选择Android
工作室>菜单栏中的首选项。Build, Execution, Deployment > Instant Run
。这是{3.1}
中的Google issue 72811718错误答案 1 :(得分:0)
在项目级别的build.gradle中,更改
classpath 'com.android.tools.build:gradle:3.3.0'
到
classpath 'com.android.tools.build:gradle:3.3.2'
为我修复了