Android Studio 3.0 migration AAPT2 error

17,840

Solution 1

Go to your gradle.properties write the below code and Sync your project

android.enableAapt2=false

enter image description here

Solution 2

Is your username in OS cyrillic? If so - you need to change the .gradle resource folder in settings to path which does not contain cyrillic symbols. In ->Settings-> Build, Execution -> Gradle change Service directory path to "C:/Users/Public/.gradle"

Share:
17,840
Admin
Author by

Admin

Updated on June 16, 2022

Comments

  • Admin
    Admin almost 2 years

    After migrating my existing project to Android Studio 3.0, it is not compiling. Below are the log details:

    Error:java.util.concurrent.ExecutionException: 
        java.util.concurrent.ExecutionException: 
    com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
    Error:java.util.concurrent.ExecutionException: 
    com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
    Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for 
    details
    Error:Execution failed for task ':app:processDebugResources'.
    Failed to execute aapt
    Information:BUILD FAILED in 27s
    Information:11 errors
    Information:0 warnings
    
  • Scott Johansen
    Scott Johansen over 6 years
    I also have a non-English character in my path and have the same problem. When I tried your suggestion, I get many errors, such as error: resource android:attr/fontStyle not found. Upon examination I see that the .gradle directory is over 900MB. I cannot add the suggested row to gradle.properties because I don't such that file in one of my projects. There's another called settings.gradle but adding the row there gives other errors.
  • kb1000
    kb1000 about 6 years
    If you can't find gradle.properties in your project, just create it as an empty file in the project's top level directory and add the setting to it.
  • meyasir
    meyasir over 5 years
    Process 'command 'C:\Users\PC\AppData\Local\Android\Sdk\build-tools\26.0.2\aa‌​pt.exe'' finished with non-zero exit value 1 after applying the above method. Any guess?