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

后端 未结 30 1787
野的像风
野的像风 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条回答
  •  旧时难觅i
    2020-11-22 13:45

    I also encountered this error. For me, it was when changing the target SDK from 26 down to 25. I was able to fix the problem by changing the appcompat dependency version from

    implementation 'com.android.support:appcompat-v7:26.1.0'

    to

    implementation 'com.android.support:appcompat-v7:25.4.0'

    This will allow the compiler to access the styling attributes that it is currently unable to find. This will actually fix the problem instead of masking the real issue as Enzokie suggested.

提交回复
热议问题