当我试图运行它时,我刚从另一个程序员那里拿了这个应用程序,它给了我一个错误说: Error:(2) Error parsing XML: XML or text declaration not at start of entity Error:Execution failed for task ‘:app:processDeb
Error:(2) Error parsing XML: XML or text declaration not at start of entity
Error:Execution failed for task ‘:app:processDebugResources’.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘C:\Users\ahmad\AppData\Local\Android\sdk\build-tools\21.1.2\aapt.exe” finished with non-zero exit value 1
这是代码:
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="6dip" > <TextView android:id="@+id/userid" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingTop="6dip" android:paddingLeft="6dip" android:textSize="17sp" android:textStyle="bold" android:visibility="gone" /> <CheckBox android:id="@+id/checkBox1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:focusable="false" android:focusableInTouchMode="false" android:text="CheckBox" /> <TextView android:id="@+id/fullname" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/checkBox1" android:layout_alignBottom="@+id/checkBox1" android:layout_toRightOf="@+id/checkBox1" android:text="TextView" /> </RelativeLayout>这是错误所讨论的XML文本声明:
<?xml version="1.0" encoding="utf-8"?>
您在文件顶部有两个.删除一个,该错误应该消失.