XML文件中Eclipse报错Unexpected namespace prefix "null" found for tag
来源:互联网 发布:淘宝描述不符监管 编辑:程序博客网 时间:2024/06/05 12:47
很神奇的问题,把源代码仔细检查了一遍没发现什么问题,代码是从网上copy的样例代码,应该不会有bug。
然后重新从网上复制粘贴了一把就好了,很让我无语。可能是Eclipse抽风了。
附上一篇网上找到的一篇关于此问题不错的帖子,还不错,供参考
=================================================
[解决方案]Unexpected namespace prefix “xmlns” found for tag Layout
原帖地址 http://www.mythroad.net/2013/02/19/%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88unexpected-namespace-prefix-xmlns-found-for-tag-layout/
形如这样的代码,出现Error:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/background" >
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView android:id="@+id/menu_top_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/name_version"
android:textColor="@color/black"
android:textSize="20sp" />
Error: "Unexpected namespace prefix "xmlns" found for tag LinearLayout". I tried the solutions provided in other similar questions also but it didn't work for me. Same error is occurr.
Solution:
Please try following:
1.Remove "?xml version="1.0" encoding="utf-8"?" line from the top.
2.Remove "xmlns:android="http://schemas.android.com/apk/res/android" from all the place excluding the ScrollView. I believe it is sufficient to inform it to the application once.
去掉 第二个"xmlns:android="http://schemas.android.com/apk/res/android"
That's All Thanks!
版权所有,转载请注明文章来源 & 保留原文链接!
- XML文件中Eclipse报错Unexpected namespace prefix "null" found for tag
- 报错::Unexpected namespace prefix "xmlns" found for tag LinearLayout
- Unexpected namespace prefix "xmlns" found for tag LinearLayout——android开发之xml布局文件
- [解决方案]Unexpected namespace prefix “xmlns” found for tag Layout
- Unexpected namespace prefix "xmlns" found for tag RelativeLayout
- “Unexpected namespace prefix "xmlns" found for tag LinearLayout”的解决方法
- Unexpected namespace prefix “xmlns” found for tag Layout
- Unexpected namespace prefix "xmlns" found for tag GridView
- Unexpected namespace prefix "xmlns" found for tag LinearLayout 改错啦
- Unexpected namespace prefix "xmlns" found for tag LinearLayout
- Unexpected namespace prefix "xmlns" found for tag LinearLayout
- 【解决方法】Unexpected namespace prefix “xmlns” found for tag Layout
- Unexpected namespace prefix "xmlns" found for tag LinearLayout
- Unexpected namespace prefix "xmlns" found for tag RelativeLayout
- Andorid 中,错误“Unexpected namespace prefix "xmlns" found for tag LinearLayout”的解决方法
- [Android开发常见问题-14] Unexpected namespace prefix "abc" found for tag SomeThing
- 错误“Unexpected namespace prefix "xmlns" found for tag LinearLayout”的解决方法
- 错误“Unexpected namespace prefix "xmlns" found for tag LinearLayout”的解决方法
- 编写高效的Android代码[转]
- 互斥与同步
- 2013腾讯编程马拉松初赛第一场(3月21日) 湫湫系列故事——减肥记II ----线段树
- 10. 选择工具要慎重
- sed 实例备忘
- XML文件中Eclipse报错Unexpected namespace prefix "null" found for tag
- STM32出现HardFault_Handler故障
- 深入Block(一)
- hdu 4639 Hehe (dp)
- Magick++ 6.8.5在MFC中的使用
- 深入Block(二)
- 加密2
- Android DES加密解密
- tabhost中activity跳转动画不显示的解决办法