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

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

    This error message (AAPT2 error: check logs for details ) is not helpful because it doesn't tell you what the real problem is.

    In my case, it was due to a missing resource XML drawable file.

    error: failed linking file resources.
    
    org.gradle.tooling.BuildException: Failed to process resources, see aapt output above for details.
    

    I only figured out because I undid the changes in the XML file, and this time I got a more helpful message:

    error: resource drawable/ic_filter_off (aka com.xxx:drawable/ic_filter_off) not found.
    
    Message{kind=ERROR, text=error: resource drawable/ic_filter_off (aka com.xxx:drawable/ic_filter_off) not found., sources=[C:\code\xxx\app\src\main\res\layout\app_bar_main.xml:69], original message=, tool name=Optional.of(AAPT)}
    

提交回复
热议问题