Error:(144) Error parsing XML: not well-formed (invalid token)、failed for task ':app:processDebugRes

近日在Android的界面开发中遇到一种问题:
Error:(144) Error parsing XML: not well-formed (invalid token)
与及
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt


查阅网上的方法,分别总结出2种可能:

          1.可能是输入时用了全角

          2.可能是<?xml version="1.0" encoding="utf-8"?>中未标明utf-8编码

但是,很遗憾两者都排查过之后还是报错:于是选中Message中的错误提示,右键之后选择Jump to Source



跳转到了XML文件出错的位置:



这时候我才恍然大悟,原来我再android:text=“”属性中填入了" < > "符号,所以提示报错了!

把不合语法的符号删除之后,点击Rebuild Project,等待




Rebuild完成之后,便不再报错了!

希望可以帮到在开发路上进击的各位,共勉!

猜你喜欢

转载自blog.csdn.net/Nobody_else_/article/details/79617582