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

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

    I got same error AAPT2 error: check logs for details, and i applied above solutions, as per most common solution, i was opened gradle.properties and add line

    android.enableAapt2=false

    for solution, but i got an error Process 'command 'D:\Android\sdk\Sdk\build-tools\27.0.3\aapt.exe'' finished with non-zero exit value 1

    But after many searches i found that there is problem in layout's xml file that i was repeat lines in layout's xml file which is as below:

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

    Remove Repeat lines from xml file and rebuild project and Done.

提交回复
热议问题