AAPT2 gradle issue in android studio 3.0 beta4
Solution 1
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.
Solution 2
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.
Solution 3
Solved it mate finally
please update your compileSdkVersion to 26.That will solve your issue.I think so
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
i have Solved it with increasing compileSDKVersion to 26
Solution 4
In my case it was caused by this line being missing from the Gradle dependencies:
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
Solution 5
For Cordova developers those working on android studio
I had faced this issue while changing the support library from com.android.support:appcompat-v7:23.0.0 to com.android.support:appcompat-v7:27.1.1 in order to support the foreground service feature of Android Oreo; to solve this add the following lines of code in build.gradle file `
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
minSdkVersion 26
targetSdkVersion 27
}
}
After that comment following lines of code in build.gradle file. **Most important
cdvCompileSdkVersion cdvCompileSdkVersion
buildToolsVersion cdvBuildToolsVersion
Rebuild the project.
![Ramkailash](https://i.stack.imgur.com/ZNVk5.jpg?s=256&g=1)
Ramkailash
PROFESSIONAL SUMMARY:-> As a senior Enterprise Programmer with 6 years of IT industry working experience in developing Enterprise applications using java(JavaEE), and related technologies, object-oriented analysis and design was demonstrated as summarized below and 2+ years of working experience in Design and Integrations using Mule ESB. Experience in all the phases of the SLDC, Client-Server and n-tires Architectures in domains like Finance and HealthCare . Expertise in implementing Service Oriented Architecture(SOA) in SOAP/RestFull web services in Mule. Designing RAML for different end points. Which is available for consumer applications to consume Creating HTTP inbounds and outbound flow, routing, Transformation and Securities of the Mule. Extensively used Mule components, which includes File, FTP, HTTP, SFTP, SMTP, DataBase Connectors, SalesForce, SAP, CXF, Invoke, Exception Handling etc.... If you need any clarification or any query. Please drop message. Solid knowledge in Java/J2EE technologies. Well experienced in MVC architecture, Spring, Spring Boot, Hibernate, JPA Experienced with different build tools, Maven, Ant and CI tools like Jenkins Experienced in using configurtion management tools, GIT, SVN Consumed Web services by implementing Spring REST support is to make the development of RESTFUL web services
Updated on September 07, 2022Comments
-
Ramkailash almost 2 years
Error: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
-
InsaneCat over 6 yearsPlease refer this it's helps you:- stackoverflow.com/questions/46988102/…
-
Android Geek over 6 yearsWhat error are you getting after adding android.enableAapt2=false in your project
-
0xAliHn about 6 yearsCheck this answer stackoverflow.com/a/50216453/3806413
-
-
IntelliJ Amiya over 6 yearsWe have already added
android.enableAapt2=false
in gradle.properties file -
Ramkailash over 6 yearsi have already checked with stable version but still facing same issue
-
Ghimire over 6 yearshave you solved your issue.I am facing Similar problem just now
-
mac229 over 6 yearsAre you using 9patches?
-
Ghimire over 6 years@mac229 if you are saying to me , i am not using any 9 patches image. but updated project to Android Studio 3.0 and facing this issue
-
Ramkailash over 6 yearsWe are facing this issue for last 6 hours before that same configuration was running fine. I have added different solutions but not working.
-
Ramkailash over 6 yearsEven we checked by updating android studio version but still facing same issue with stable version.
-
Ghimire over 6 yearsWhats the main issue .I don't get it. @Ramkailash if you got solution ,please mention me also.that will be great help
-
Ramkailash over 6 yearsCould you please tell me Android Studio version?
-
Ramkailash over 6 yearsI have changed compileSDKVersion 26 and buildToolsVersion '26.0.2'. But still facing same issue.
-
Ghimire over 6 yearsI have Android studio 3.0.Please remove the android.enableAapt2=false whaich you have added
-
Mafujul over 6 yearsI am using 9patch images. When I want to use 9patch image I am facing this problem.
-
Ghostx0 over 6 yearsRead my comment it's about adding the gradle properties file, which no one has mentioned.
-
Enzokie over 6 yearsThat means you are answering a wrong question. The OP is not asking how to find the
gradle.properties
or how to create agradle.properties
in case if it is not found anywhere. -
Ghostx0 over 6 yearsquite a toxic little fella aint yah
-
Enzokie over 6 yearsWhich part is toxic? Please don't interpret my previous comment badly, I am just actually trying to help.