2

Can someone please check my .xml and see if anything is off? I am sure this has been working on my desktop setup, but not on my laptop.

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>
Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Adam Lee
  • 2,983
  • 7
  • 35
  • 47

2 Answers2

2

It's the "&" symbol in the string on line 12. You can delete it to verify this.

The solutions (here) are to use &amp; instead of &,

android:text="Save &amp; Submit"

or to use the unicode \u0026 character

android:text="Save \u0026 Submit"
Tyler V
  • 9,694
  • 3
  • 26
  • 52
0

symbols sometime would create errors event though it wont make those squiggly red lines under it. try to delete the symbols on yout textview one at a time and see which creates errors.

Dharman
  • 30,962
  • 25
  • 85
  • 135
user880355
  • 21
  • 2