gpt4 book ai didi

Android Studio 错误解析 XML : not well-formed (invalid token)

转载 作者:行者123 更新时间:2023-11-29 01:01:01 31 4
gpt4 key购买 nike

有人可以检查我的 .xml 并查看是否有任何问题吗?我确信这在我的桌面设置上有效,但在我的笔记本电脑上无效。

Error parsing XML: not well-formed (invalid token)
Message{kind=ERROR, text=Error parsing XML: not well-formed (invalid token), sources=[/home/adam/6300Summer18Team67/GroupProject/SDPCryptogram/app/src/main/res/layout/solve_cryptogram_activity.xml:12], original message=, tool name=Optional.of(AAPT)}

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
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">

<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Save & Submit"
tools:layout_editor_absoluteX="121dp"
tools:layout_editor_absoluteY="426dp" />

<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Puzzle #"
tools:layout_editor_absoluteX="109dp"
tools:layout_editor_absoluteY="52dp" />

<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="In Progress..."
tools:layout_editor_absoluteX="121dp"
tools:layout_editor_absoluteY="88dp" />

<EditText
android:id="@+id/editText2"
android:layout_width="24dp"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="number"
android:text="@string/numAttempts"
tools:layout_editor_absoluteX="74dp"
tools:layout_editor_absoluteY="122dp" />

<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="incorrect submissions"
android:textAlignment="center"
tools:layout_editor_absoluteX="111dp"
tools:layout_editor_absoluteY="134dp" />

<EditText
android:id="@+id/editText3"
android:layout_width="29dp"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="number"
android:text="@string/cryptogramId"
tools:layout_editor_absoluteX="163dp"
tools:layout_editor_absoluteY="35dp" />

<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cryptogram"
tools:layout_editor_absoluteX="48dp"
tools:layout_editor_absoluteY="217dp" />

<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Substitution"
tools:layout_editor_absoluteX="48dp"
tools:layout_editor_absoluteY="274dp" />

<TextView
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Decryption Preview"
tools:layout_editor_absoluteX="48dp"
tools:layout_editor_absoluteY="339dp" />

<TextView
android:id="@+id/textView7"
android:layout_width="212dp"
android:layout_height="34dp"
android:text="TextView"
android:textAlignment="center"
android:textSize="18sp"
android:typeface="normal"
tools:layout_editor_absoluteX="141dp"
tools:layout_editor_absoluteY="217dp"
tools:text="@string/cryptogram" />

<EditText
android:id="@+id/editText5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPersonName"
android:singleLine="true"
android:text="Name"
tools:layout_editor_absoluteX="141dp"
tools:layout_editor_absoluteY="265dp" />

</android.support.constraint.ConstraintLayout>

最佳答案

是第12行字符串中的“&”符号,可以删除验证。

解决方案(here)是使用&代替&

android:text="Save &amp; Submit"

或者使用 unicode \u0026 字符

android:text="Save \u0026 Submit"

关于Android Studio 错误解析 XML : not well-formed (invalid token),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51139346/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com