<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
<Button Android:id="@+id/button0"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="abc" />
</LinearLayout>本人初学者,以上是我的一个main.xml文件,不知道为什么总是有下面的错误提示:
- ERROR Error parsing XML: unbound prefix
- The prefix "Android" for attribute "Android:id" associated with an element type "Button" is not bound.哪位大虾们指点一下~

解决方案 »

  1.   


    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent">//此处少了“>”
    <Button android:id="@+id/button0"//小写怕android
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:text="abc" />
    </LinearLayout>
      

  2.   

    谢谢sodino,“>”是我在发帖的时候漏掉的,貌似不是这个原因,后来重新装了ADT,并且重新创建了项目,现在好了
    分给你吧~
      

  3.   

    这个问题到底是什么原因咧,我也碰到了,但是不想重装ADT了
      

  4.   

    我知道了,是大小写的原因。Button android:id="@+id/button0"//小写android
      

  5.   

    是大小写问题,@+id/button 改成小写就好了
      

  6.   

    你的main.XML的命名是不是带有数字呢?如果有就去掉数字!
      

  7.   

    我的也有问题,按着你们说的都试了(除了重新装ADT),都么成功
    <?xml version="1.0" encoding="utf-8"?><LinearLayout android:id="@+id/linearlayouta"
             android:orientation="horizontal"
             android:layout_width="fill_parent"
             android:layout_height="wrap_content">
       <GridView xmlns:android="http://schemas.android.com/apk/res/android"
             android:id="@+id/gridview"
             android:numColumns="auto_fit"
             android:stretchMode="columnWidth"         android:horizontalSpacing="0dp" android:verticalSpacing="0dp"
             android:layout_width="240dp" android:columnWidth="60dp"
             android:layout_height="450dp" android:gravity="left">
       </GridView>
       <LinearLayout android:id="@+id/linearlayoutb"
             android:orientation="vertical" android:layout_width="60dp"
             android:layout_height="wrap_content">
             <Button android:id="@+id/button" android:text="back" android:layout_height="wrap_content"
                    layout_width="wrap_content"></Button>
             <Button android:id="@+id/button1" android:text="down" android:layout_width="wrap_content"
                 android:layout_height="wrap_content"></Button>
             <Button android:id="@+id/button2" android:text="up" android:layout_width="wrap_content"
                 android:layout_height="wrap_content"></Button>
             <Button android:id="@+id/button3" android:text="lock" android:layout_width="wrap_content"
                 android:layout_height="wrap_content"></Button>
      </LinearLayout>
    </LinearLayout>[2011-03-24 16:37:25 - TestGrid] D:\TestGrid\res\layout\main.xml:3: ERROR Error parsing XML: unbound prefix
      

  8.   

    android写错了  估计是  自习检查下  这个问题大部分都是这样
      

  9.   

    我也遇到过这样的问题这个把提示错误的那几行先删除掉,然后再重新写一下应该就OK了具体是什么原因也不太清楚,也可能是代码没有错误,是它本身IDE的bug,
      

  10.   


    自己没找到原因就说是bug,最鄙视这种人的
      

  11.   


    我的就是这个原因,把android打成adnroid了,害我找了半天错误
      

  12.   

    我也出现过这样的bug,是因为在xml最开始没有加上 xmlns:android="http://schemas.android.com/apk/res/android"
      

  13.   

    最可能的原因就是把android写错了,以后写代码要小心啊~
      

  14.   

    我看了帖子去找了一下发现android:text="Cancel"打成了abdroid:text="Cancel"神呀!找了半天没找出来,感谢LZ和找到答案的!
      

  15.   

    <?xml version="1.0" encoding="utf-8"?>
    <set xmlns:android="http://schemas.android.com/apk/res/android"
            android:interpolator="@android:anim/decelerate_interpolator"
            android:zAdjustment="top">
        <scale android:fromXScale="1.0" android:toXScale=".5"
               android:fromYScale="1.0" android:toYScale=".5"
               android:pivotX="50%p" android:pivotY="50%p"
               android:duration="@android:integer/config_mediumAnimTime" />
        <alpha android:fromAlpha="1.0" android:toAlpha="0"
               android:duration="@android:integer/config_mediumAnimTime"/>
    </set>
    类似这样的 Android中A不能大写
      

  16.   

    </LinearLayout>
    改成</LinerLayout>就没事了
      

  17.   

    肯定是把android写错了,或者没有对应的括号。不是bug
      

  18.   

    哥哥们···这是命名空间没有输入···
    看看这里
    http://www.cnblogs.com/yibaolin/archive/2011/06/05/2072998.html
      

  19.   

    我能吐槽么,我把android写成了andriod,还写了四行,哎,找了半天,没有找到错误
      

  20.   

    ⊙﹏⊙b汗~~我的也是因为把android写成andriod了~~~
      

  21.   

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >
        <TableLayout 
            <TextView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:stretchColumns="1">
           <TableRow>
               
                android:text="测试Layout:"
                abdroid:id="@+id/layoutTextView01"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textColor="@color/red_bg"   
                   />
               <EditText 
               android:text=""
               android:id="@+id/EditText01"
               android:layout_width="fill_parent"
               android:layout_height="wrap_content"
               
                   />
           </TableRow>
           <TableRow android:gravity="right">
               <Button
               android:text="Test"
               android:id="@+id/layoutButton01"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"/>
           </TableRow>
            
            ></TableLayout></LinearLayout>error: Error parsing XML: unbound prefix
    我也遇到这种错误,不知道怎么解决,请求大虾帮忙,非常感谢!
      

  22.   

    警告自己不能再犯低级错误了,但是即使犯了,也不要马上求救别人。
    android