Reputation: 451
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
Upvotes: 0
Views: 3231
Reputation: 161
In the project-level build.gradle, changing
classpath 'com.android.tools.build:gradle:3.3.0'
to
classpath 'com.android.tools.build:gradle:3.3.2'
Fixed it for me
Upvotes: 0
Reputation: 9153
The task that is failing is:
:app:transformDexWithInstantRunDependenciesApkForDebug
Try turning off Instant Run:
Settings
or Preferences
dialog: On Windows
or Linux
,
select File > Settings from the menu bar. On Mac OSX, select Android
Studio > Preferences from the menu bar.Build, Execution, Deployment > Instant Run
.This is Google issue 72811718 a bug in AS 3.1+
Upvotes: 9