解析XML时出错:XML声明格式不正确

时间:2016-09-07 02:25:14

标签: android xml

这是activity_main_activity_Test.xml

<?xml version="1.0" ecoding="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"
                  tools:context=".MainActivityThree">
    <EditText
        android:id="@+id/edit_message"
        android:layout_width="wrap_content"
        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>

我有两个错误:

1.Error:(1) Error parsing XML: XML declaration not well-formed
2.Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException:
      org.gradle.process.internal.ExecException: Process 'command
      'C:\Users\hasee\AppData\Local\Android\Sdk\build-tools\24.0.1\aapt.exe''
      finished with non-zero exit value 1

1 个答案:

答案 0 :(得分:3)

ecoding一词的第一行有拼写错误encoding

<?xml version="1.0" encoding="utf-8"?>