在XML文件中使用了自定义的域名空间(ns),如app:,编译时报错XXX
XML文件类似于如下:

<?xml version="1.0" encoding="utf-8"?><LinearLayout android:orientation="vertical" android:id="@+id/myScrollLayout" android:layout_width="fill_parent"  android:layout_height="wrap_content">    <TextView android:layout_height="wrap_content" android:layout_width="fill_parent"     android:text="Family" android:id="@+id/Family"     android:textSize="16px" android:padding="5px"     android:textStyle="bold" android:gravity="center_horizontal">    TextView>    <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"        android:layout_width="fill_parent" android:layout_height="wrap_content"        android:orientation="vertical" android:scrollbars="vertical">        <LinearLayout android:orientation="vertical" android:id="@+id/myMainLayout"         android:layout_width="fill_parent"  android:layout_height="wrap_content">        LinearLayout>    ScrollView>LinearLayout>

解决方案:
增加域名空间:

A couple of reasons that this can happen:
1. You see this error with an incorrect namespace, or a typo in the attribute. Like ‘xmlns’ is wrong, it should be xmlns:android
2. First node needs to contain:
xmlns:android=”http://schemas.android.com/apk/res/android”
3. If you are integrating AdMob check custom parameters like ads:adSize, you need
xmlns:ads=”http://schemas.android.com/apk/lib/com.google.ads”
4. If you are using LinerLayout you might have to define tools
xmlns:tools=”http://schemas.android.com/tools”
xmlns:app=”http://schemas.android.com/apk/res-auto”

更多相关文章

  1. 在Linux上配置Android自动化构建环境 ---- Jenkins自动化部署学
  2. Android签名文件相关查看和修改
  3. android studio 一次编译错误:Error:Minimum supported Gradle ve
  4. Android(安卓)studio Gradle download 文件 路径
  5. 解决 pinyin4j 在Android(安卓)某些编译环境下不能用
  6. [原创]Android(安卓)init.rc文件解析过程详解(二)
  7. Android学习笔记_31_通过后台代码生成View对象以及动态加载XML布
  8. Android(安卓)MID BootSound
  9. android adb配置

随机推荐

  1. 什么是Less?koala配置及使用
  2. 使用Action的模型绑定实例教程
  3. C#中networkcomms3.0如何实现模拟登陆的
  4. Parser(解析器)的使用实例教程
  5. EF架构--FluentValidation的实际用法
  6. 关于csharp的实例教程
  7. 微信公众平台SDK核心库的详细介绍
  8. C#集合类有哪些?
  9. C# 中GUID生成格式有哪些方法
  10. 总结MVC中数据验证实例