错误:(2)解析XML时出错:XML或文本声明不在实体android studio
发布时间:2020-12-16 22:41:12 所属栏目:百科 来源:网络整理
导读:当我试图运行它时,我刚从另一个程序员那里拿了这个应用程序,它给了我一个错误说: 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
当我试图运行它时,我刚从另一个程序员那里拿了这个应用程序,它给了我一个错误说:
这是代码: <?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"?> 您在文件顶部有两个.删除一个,该错误应该消失. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |