XML文件中的错误:中止构建.在android上

Mah*_*EFE 3 xml android building

我在构建android项目时遇到问题.

我构建Android项目,我收到一个错误.错误是:"XML文件中的错误:中止构建.".我尝试了所有解决方案.

  • 我删除了main.out.xml.在那之后,我清理了项目.但它没有用
  • xml文件中没有错误
  • 我删除了bin文件夹.它最初起作用了.但是当我在xml文件中更改任何内容时,我得到相同的错误

我的xml文件是:

<?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"
    android:background="@drawable/background">


    <TextView  
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:text="Telefon numaras? :"
        />     
    <EditText 
        android:id="@+id/txtPhoneNo"  
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content"        
        />
    <TextView  
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content"         
        android:text="Mesaj :"
        />     

    <EditText
        android:id="@+id/txtMessage"
        android:layout_width="fill_parent"
        android:layout_height="150dp"
        android:gravity="top"
        android:text="@string/txtMessage" />

    <Button
        android:id="@+id/btnSendSMS"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/btnSendSMS" />

</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

小智 5

确保您的xml文件名为小写字母,不要使用数字.仅使用dot例如main.xml.在创建xml后,右键单击> Source> Format.运行你的应用程序好运.