Java Android资源编译失败,为什么会出现这种情况

Java Android资源编译失败,为什么会出现这种情况,java,android,Java,Android,这是.xml文件这里的错误是什么 <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.co

这是.xml文件这里的错误是什么

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:paddingLeft="16dp"
        android:paddingRight="16dp"
        tools:ignore="MissingConstraints">

        

        <EditText
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:hint="Subject">

            <EditText
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:gravity="top"
                android:hint="Message">
        <Button
            android:layout_width="100dp"
            android:layout_height="wrap_content"
            android:gravity="right"
            android:text="send">

    </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

之后,它向我显示Android资源编译失败。。。和 AAPT:错误:格式不正确(无效令牌)


您没有使用
/>
正确关闭标签, 您的xml代码应该位于线性布局的下方

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:paddingLeft="16dp"
    android:paddingRight="16dp"
    tools:ignore="MissingConstraints">



    <EditText
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:hint="Subject"/>

    <EditText
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:gravity="top"
        android:hint="Message"/>
    <Button
        android:layout_width="100dp"
        android:layout_height="wrap_content"
        android:gravity="right"
        android:text="send"/>

</LinearLayout>


是,由于缺少结束标记而显示。。。谢谢老兄…欢迎老兄,如果这个答案有帮助的话,你应该接受或投票,谢谢