The markup in the document following the root element must be well-formed. What is the cause of this?

烂漫一生 提交于 2019-12-13 04:41:24

问题


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
 <EditText android:id="@+id/edit_message"
    android:layout_weight="1"
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:hint="@string/edit_message" />
<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/button_send" />
</LinearLayout>

<resources>
<string name="app_name">becreativebuddy</string>
</resources>

im getting the error in line 18 out of 20. I am following a tutorial word for word because i am very new to this. I would like to get into the habit of localizing, but is frustrating because when i dont have the it compiles and runs just fine. I apologize if it is a simple error, but i have not found anything online the helps me. As mentioned before i am new to this so try to keep it simple.


回答1:


You need to delete the 3 lines at the end of your file starting with <resources>. Move these 3 lines into a new file in your resources directory.



来源:https://stackoverflow.com/questions/16637251/the-markup-in-the-document-following-the-root-element-must-be-well-formed-what

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!