Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AAPT2 gradle issue in android studio 3.0 beta4

enter image description hereError:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details

We have already added android.enableAapt2=false in gradle.properties file

like image 965
Ramkailash Avatar asked Dec 12 '25 13:12

Ramkailash


2 Answers

For me, there was no need to add android.enableAapt2=false to my gradle.properties. The solution for me was to make sure that in my gradle build file my compileSdkVersion is set to 26, buildToolsVersion is set to 26.0.2 and targetSdkVersion is set to 26.

Note: In my build file, I had to do this check for all target and compile sdkVersions including product flavors:

  • mobile
  • tv

I am using Android Studio 3.0.1.

like image 99
chornge Avatar answered Dec 14 '25 11:12

chornge


For anyone who is still having issues, i.e loading up demos etc or importing projects. You need to make sure (like everyone else has stated):

You add the following statement to your gradle.properties file

android.enableAapt2=false

Now here is for the bit that they should have filled you in on. Chances are if you have imported a project there may not be a gradle.properties file this can be for a wide range of reasons old gradles being used auto fixing issues on build etc.

But seriously, If you can't find it right click in gradle scripts and click on new resource bundle and type gradle. This will create a gradle.properties just paste that code there and run the program. I would not use this as a permanent work around. I stumbled across this whilst importing a project that didn't have a gradle attached to the folder, normally making an app from scratch will have the properties file there.

like image 29
Ghost.Idle Avatar answered Dec 14 '25 12:12

Ghost.Idle



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!