在修改了Android布局文件后,编译出现Error parsing XML: not well-formed (invalid token)。

首先先排查xml文件的编码格式是否为UTF-8, <?xml version="1.0" encoding="utf-8"?> ,注意,从别处copy的要留意编码格式!

还有各个标签是否有遗漏,把鼠标箭头移到出错误的layout上 点击鼠标右键选择Source然后再选Format。

都没有问题,结果发现报错处(第9行):

 <TextView

      android:id="@+id/TetxView1"

      android:layout_width="wrap_content"

      android:layout_height=“wrap_content”

      android:text=">31"

      android:textSize="@dimen/text_size"

      android:textColor="@color/text_color"

    />

在控件属性值里包含“>”或“<”,就会出错,建议在代码中赋值!

Android 编译错误——布局 Error parsing XML: not well-formed (invalid token)的更多相关文章

  1. Error parsing XML: junk after document element这样的错误 - CSDN博客

    很多开发者可能在编写XML布局文件时提示Error parsing XML: junk after document element这样的错误,这里Android123提示大家一般合法的XML文件只有 ...

  2. android studio 报 Error:(79) Error parsing XML: not well-formed (invalid token)

    android studio 报 Error:(79) Error parsing XML: not well-formed (invalid token) 我的原因是因为string 里面有< ...

  3. DataBinding注意事项Error parsing XML: duplicate attribute以及如何在listview中使用DataBinding

    <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android=&quo ...

  4. activiti 发布异常 org.activiti.engine.ActivitiException: Error parsing XML

    三月 23, 2015 1:58:31 下午 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() fo ...

  5. Spring Boot项目错误:Error parsing lifecycle processing instructions

    pom.xml文件错误:Error parsing lifecycle processing instructions 解决方法:清空.m2/repository下的所有依赖文件,重新下载即可解决该问 ...

  6. 编译错误:error: multi-line comment

    编译错误:error: multi-line comment  这其实是有宏定义的地方的问题. 原因是宏定义非一行,在宏定义的行尾使用 '\' 连接符导致的. 所以这个地方的注释使用 /*   */ ...

  7. VS2012与VS2015同时安装用VS2012创建MFC程序时弹出编译错误”fatal error C1083: 无法打开包括文件:“mprapidef.h”: No such file or directory”的解决办法

    在WIndows 7操作系统上同时安装VS2012与VS2015并用VS2012创建MFC程序时弹出编译错误”fatal error C1083: 无法打开包括文件:“mprapidef.h”: No ...

  8. vs2008编译错误fatal error C1902: 程序数据库管理器不匹配;请检查安装解决

    重装了本本上的Xp系统,如往常一样,升级,装杀毒软件,开发工具.一些进行的非常顺利.然而,在我打开VS2008准备耕作的时候,尽然出现了一邪恶的错误提示:vs2008编译错误fatal error C ...

  9. VS2017编译错误:#error: Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version

    VS2017编译错误:#error: Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll ve ...

随机推荐

  1. Atitit.编程语言新特性 通过类库框架模式增强 提升草案 v3 q27

    Atitit.编程语言新特性 通过类库框架模式增强 提升草案 v3 q27 1. 修改历史2 2. 适用语言::几乎所有编程语言.语言提升的三个渠道::语法,类库,框架,ide2 2.1. 单根继承  ...

  2. First MFC

    // stdafx.h : include file for standard system include files, // or project specific include files t ...

  3. MVC | 微软自带的Ajax请求

    @Ajax.BegForm( )  用来生成异步表单 Home控制器 using System; using System.Collections.Generic; using System.Linq ...

  4. TBS 手册 --phpv 翻译

    为何使用它? 示例 下载 手册 支持 论坛 推荐 秀出你的站点 http://phpv.net/TBS_Manual.htm#html_automatic 网站: http://www.tinybut ...

  5. TFS中如何排除Nuget的Packages文件夹

    在项目的解决方案下新增.tfignore文件.文件内容如下: \packages 在项目的解决方案下新增.nuget文件夹,并新增Nuget.config文件,文件内容如下: <?xml ver ...

  6. Visual Studio 调试小技巧-从查看窗口得到更多信息(转)

    原文地址:http://blog.csdn.net/cadcisdhht/article/details/5651488

  7. [原创]超强C#图片上传,加水印,自动生成缩略图源代码

    <%@ Page Language=“C#“ AutoEventWireup=“true“ %> <%@ Import Namespace=“System“ %> <%@ ...

  8. iOS_25_彩票骨架搭建+导航栏适配

    终于效果图: Main.storyboard 初始化的控制器是:导航控制器 它的根控制器是:TabBarController TabBarController的底部是一个自己定义的TabBar 里面加 ...

  9. oracle如何将数据导入到另一个表空间

    某个用户的数据在USER表空间里,如果多个用户的数据都在USERS表空间内,将严重影响系统性能,一般在系统迁移的时候,在新的系统里希望导入 一个独立的用户表空间,但是经常无法导入用户指定的缺省表空间, ...

  10. hdu3208 Power of Integer

    /** 题目:H - Power of Integer 链接:https://vjudge.net/contest/152887#problem/H 题意:给出区间[a, b],问你区间[a, b]所 ...