AAPT2 working abnormally in android studio 3.1 both for True and False flag

后端 未结 5 1740
长发绾君心
长发绾君心 2021-01-12 20:14

I am usingandroid.enableAapt2 = false in my gradle.properties file. After updating android studio to 3.1 my project showing a warning to update or

相关标签:
5条回答
  • 2021-01-12 20:52

    Update the project gradle dependencies. The code is below.

     dependencies {
            classpath 'com.android.tools.build:gradle:3.1.3'
    
    
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    
    0 讨论(0)
  • 2021-01-12 21:04

    Ensure that all your res resources are of a valid type. In my case I had a .mov file in my res/raw directory.

    0 讨论(0)
  • 2021-01-12 21:07

    When upgrading Gradle and starting to use Aapt2 I also got some similar errors building the project. In my case the problem was in a drawable resource file that required a higher API version as it was my minSdkVersion set in build.gradle. The main problem was that file did not show any error until you opened it, so it was hard to find it at all. I have spent at least 4 hours trying other things, since as an error when building the project it showed another drawable resource (as not found) files that did not have any problems at all. After removing the drawable that required the higher API the app built normally.

    Gradle 4.4, com.android.tools.build:gradle:3.1.4, Android studio: 3.1.4

    0 讨论(0)
  • 2021-01-12 21:09

    I Solved this issue going in gradle build file (build.gradle) in line: "classpath 'com.android.tools.build:gradle:3.1.0'" this is the latest version in Android Studio 3.1

    change this line: "classpath 'com.android.tools.build:gradle:3.1.0'" to : "classpath 'com.android.tools.build:gradle:3.0.0'" and add "android.enableAapt2=false" in gradle.properties.

    the Android Studio going to install all dependencies automotically and you be able to compile the application normally

    obs: forgive my poor english

    0 讨论(0)
  • 2021-01-12 21:10

    Finally, I have fixed the issue by updating android gradle plugin to alpha version.

    Update your android gradle plugin in your project level build.gradle file like below:

    classpath 'com.android.tools.build:gradle:3.2.0-alpha13'
    

    Now update android.enableAapt2=true. Then check and build your project. Issue will be resolved.

    0 讨论(0)
提交回复
热议问题