user2101081
user2101081

Reputation: 451

Android studio update (3.1.1) and now app won't run

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

Answers (2)

sp00ky
sp00ky

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

Jon Goodwin
Jon Goodwin

Reputation: 9153

The task that is failing is: :app:transformDexWithInstantRunDependenciesApkForDebug

Try turning off Instant Run:

  1. Open the 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.
  2. Navigate to Build, Execution, Deployment > Instant Run.
  3. Uncheck the box next to Restart activity on code changes.
  4. Re-build.

This is Google issue 72811718 a bug in AS 3.1+

Upvotes: 9

Related Questions