Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details

后端 未结 30 1794
野的像风
野的像风 2020-11-22 12:51

This is the output of my Gradle console, I am unable to build my project

D:\\Android Projects\\....\\app\\src\\main\\res\\layout\\topic_view_header.xml
Error         


        
30条回答
  •  不知归路
    2020-11-22 13:49

    Important Update

    Do not add this line to your project as other answers. Because it is already resolved in newer Gradle versions.

    You can update your build gradle version in Project level build.gradle to latest.

    buildscript {
        dependencies {
            // choose latest if available
            classpath 'com.android.tools.build:gradle:3.3.0-alpha06'
        }
    }
    

    and gradle-wrapper.properties

    // choose latest if available
    distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip
    

    That's All! Sync and Run, Bingo!

    More info Android Documentation

    If you add, you will get an warning android.enableAapt2=false

    WARNING: The option 'android.enableAapt2' is deprecated and should not be used anymore. Use 'android.enableAapt2=true' to remove this warning. It will be removed at the end of 2018.

提交回复
热议问题