Android Studio更新(3.1.1)和现在的应用程序将无法运行
问题描述:
所以今天早上我将android studio更新到3.1.1,去更改一些代码并再次运行我的应用程序,但是我不断收到错误消息,不确定如何解决它,我已经在SO和Google上进行了搜索,但是避风港没有看到与此相关的任何信息.我也尝试过清理和重建,并且在尝试构建或运行应用程序时仍然遇到相同的错误.
So I updated my android studio this morning to 3.1.1 and went to change some code and run my app again but I keep getting errors and not sure how to fix it, I have searched on SO and with Google, but haven't seen anything that relates to this. I have also tried to clean and rebuild as well and still same errors when trying to build or run app.
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
答
失败的任务是:
:app:transformDexWithInstantRunDependenciesApkForDebug
尝试关闭即时运行":
- 打开
Settings
或Preferences
对话框:在Windows
或Linux
上, 从菜单栏中选择文件>设置.在Mac OSX上,选择"Android" 菜单栏中的Studio>首选项. - 导航到
Build, Execution, Deployment > Instant Run
. - 取消选中,重新启动代码更改活动旁边的框.
- 重建.
- Open the
Settings
orPreferences
dialog: OnWindows
orLinux
, select File > Settings from the menu bar. On Mac OSX, select Android Studio > Preferences from the menu bar. - Navigate to
Build, Execution, Deployment > Instant Run
. - Uncheck the box next to Restart activity on code changes.
- Re-build.
这是 Google问题72811718 AS 3.1+中的一个错误
This is Google issue 72811718 a bug in AS 3.1+