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

后端 未结 30 1752
野的像风
野的像风 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:47

    I just had this problem when trying to use data bind and declaring the layout tag. I know it is a bit late but for the sake of anyone encountering this problem, What I did to resolve the issue after so many attempts was that on your root layout when you are not using data bind say for example this

           
    

    remove the

    xmlns:android="http://schemas.android.com/apk/res/android"
            xmlns:app="http://schemas.android.com/apk/res-auto"
            xmlns:tools="http://schemas.android.com/tools"
    

    and just put it on your layout tag(that is if you are using data binding)

    
    
    
    

    and hopefully it will work. the android.enableAapt2=false didn't work for me so I have to remove everything and try to figure out why I get the error when I put layout tag and use data binding thus I came up with the solution. Hope it helps

提交回复
热议问题