由于发截图不方便,请大家见谅。
错误1:Description Resource Path Location Type
Element type "Button" must be followed by either attribute specifications, ">" or "/>". activity_main.xml /Calcultor/res/layout line 15 Android XML Format Problem
错误2:Description Resource Path Location Type
error: Error parsing XML: not well-formed (invalid token) activity_main.xml /Calcultor/res/layout line 16 Android AAPT Problem
错误代码:
<Button android:text="@string/1"android:id="@+id/1"android:layout_width="50dp"android:layout_height="50dp"/>错误1所指处
<Button android:text="@string/2"android:id="@+id/2"android:layout_width="50dp"android:layout_height="50dp"/>错误2所指出求各位好心人帮忙解答下,谢谢了。

解决方案 »

  1.   

    <Button android:text="@string/1"android:id="@+id/1"android:layout_width="50dp"android:layout_height="50dp"/>错误1所指处
    <Button android:text="@string/2"android:id="@+id/2"android:layout_width="50dp"android:layout_height="50dp"/>错误2所指出
      

  2.   

    Element type "Button" must be followed by either attribute specifications, ">" or "/>"
    我猜你外面没套布局
      

  3.   


    <RelativeLayout  
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"  
        android:layout_height="fill_parent">  
        <Button  android:text="@string/1" android:id="@+id/1" android:layout_width="50dp" android:layout_height="50dp"/>
    <Button android:text="@string/2" android:id="@+id/2" android:layout_width="50dp" android:layout_height="50dp"/>
    </RelativeLayout> 
    我觉得是你的button中各个属性之间没有加空格
      

  4.   

    麻烦在最后面的"/>"与"50dp"空格一下   没见过这么扣得xml布局~
      

  5.   

    <Button     
     android:text="@string/1"
     android:id="@+id/1"
     android:layout_width="50dp"
     android:layout_height="50dp" />
    <Button 
     android:text="@string/2"
     android:id="@+id/2"
     android:layout_width="50dp"
     android:layout_height="50dp" /> 
      

  6.   

    说的就是我哎,找了半天错误,少了“>”还影响到了R.java文件中的内容 ==!