错误解析XML:格式不正确(无效令牌)

Jamesokbo

编译我的android项目时收到以下消息:

错误解析XML:格式不正确(无效的令牌)

这是XML布局文件,应该认为是该错误:

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical" android:layout_width="match_parent"
        android:layout_height="match_parent">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="0.5"
            android:layout_marginEnd="5dp"
            android:layout_marginStart="5dp">

            <TextView
                android:id="@+id/pH_View"
                android:text="pH= "
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="20dp"
                android:layout_marginBottom="20dp"
                android:textSize="20sp"
                android:layout_marginStart="10sp"

                />
            <TextView
                android:id="@+id/pH_Data"
                android:textSize="18sp"
                android:text=""
                android:layout_toLeftOf="@id/ph_Graph"
                android:layout_alignBaseline="@id/pH_View"
                android:layout_margin="5dp"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignBottom="@id/pH_View"

                />
            <Button
                android:text="Graph"
                android:id="@+id/ph_Graph"
                android:layout_alignParentEnd="true"
                android:layout_alignBaseline="@id/pH_View"
                android:textAllCaps="false"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"

                />

            <TextView
                android:id="@+id/EC_View"
                android:text="EC (uS/cm2)= "
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:layout_marginTop="20dp"
                android:layout_marginBottom="20dp"
                android:textSize="20sp"
                android:layout_marginStart="10sp"
                android:layout_below="@id/pH_View"

                />
            <TextView
                android:id="@+id/EC_Data"
                android:textSize="18sp"
                android:text=""
                android:layout_toLeftOf="@id/EC_Graph"
                android:layout_alignBaseline="@id/EC_View"
                android:layout_margin="5dp"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                />

            <Button
                android:text="Graph"
                android:id="@+id/EC_Graph"
                android:layout_alignParentEnd="true"
                android:layout_alignBaseline="@id/EC_View"
                android:textAllCaps="false"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                />

            <TextView
                android:id="@+id/DO_View"
                android:text="Dissolved Oxygen= "
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:layout_marginTop="20dp"
                android:layout_marginBottom="20dp"
                android:textSize="20sp"
                android:layout_marginStart="10sp"
                android:layout_below="@id/EC_View"

                />
            <TextView
                android:id="@+id/DO_Data"
                android:textSize="18sp"
                android:text=""
                android:layout_toLeftOf="@id/EC_Graph"
                android:layout_alignBaseline="@id/DO_View"
                android:layout_margin="5dp"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                />

            <Button
                android:text="Graph"
                android:id="@+id/DO_Graph"
                android:layout_alignParentEnd="true"
                android:layout_alignBaseline="@id/DO_View"
                android:textAllCaps="false"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                />
            <TextView
                android:id="@+id/resTemp_View"
                android:text="Reservoir Temp (C)= "
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:layout_marginTop="20dp"
                android:layout_marginBottom="20dp"
                android:textSize="20sp"
                android:layout_marginStart="10sp"
                android:layout_below="@id/DO_View"

                />
            <TextView
                android:id="@+id/resTemp_Data"
                android:textSize="18sp"
                android:text="None"
                android:layout_toLeftOf="@id/EC_Graph"
                android:layout_alignBaseline="@id/resTemp_View"
                android:layout_margin="5dp"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                />

            <Button
                android:text="Graph"
                android:id="@+id/resTemp_Graph"
                android:layout_alignParentEnd="true"
                android:layout_alignBaseline="@id/resTemp_View"
                android:textAllCaps="false"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                />
            <TextView
               android:id="@+id/groveTemp_View"
               android:text="Grove Temp (C)= "
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"
               android:layout_centerVertical="true"
               android:layout_marginTop="20dp"
               android:layout_marginBottom="20dp"
               android:textSize="20sp"
               android:layout_marginStart="10sp"
               android:layout_below="@id/resTemp_View"
               />

          <TextView
               android:id="@+id/groveTemp_Data"
               android:textSize="18sp"
               android:text="None"
               android:layout_toLeftOf="@id/EC_Graph"
               android:layout_alignBaseline="@id/groveTemp_View"
               android:layout_margin="5dp"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"
               />

            <Button
                android:text="Graph"
                android:id="@+id/groveTemp_Graph"
                android:layout_alignParentEnd="true"
                android:layout_alignBaseline="@id/groveTemp_View"
                android:textAllCaps="false"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                />


        </RelativeLayout>

        <RelativeLayout
            android:layout_height="match_parent"
            android:layout_width="match_parent"
            android:layout_weight="1"
            android:orientation="horizontal"
            android:layout_margin="40dp">


            <Button
                android:id="@+id/requestConnection"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:text="Request Connection"
                android:onClick="requestConnection"
                android:layout_centerInParent="true"
                />

            <Button
                android:id="@+id/requestReading"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:layout_gravity="center"
                android:text="Request Reading"
                android:onClick="requestReading"
                android:layout_centerInParent="true"
                />

       </>

   </LinearLayout>

谁能帮我找到问题所在?我想念什么吗?

詹妮·兰格(JNYRanger)

</> 在XML文件中不是有效的令牌。

的结束标记RelativeLayout应为</RelativeLayout>

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Android XML解析错误(无效令牌,格式不正确)

XML文件错误-Android(解析XML错误:格式不正确(无效的令牌))

错误:(41)解析XML时出错:格式不正确(无效的令牌)+无法解析符号R

xml解析问题:格式不正确(无效的令牌)

安卓。Gradle构建错误:解析XML错误:格式不正确(无效的令牌)

错误:(3)解析XML错误:格式不正确(无效的令牌)

Android Studio解析XML错误:格式不正确(无效令牌)

XML解析错误:<id>元素的格式不正确(无效令牌)

错误:(45) 解析 XML 时出错:格式不正确(令牌无效)因为按钮“<<”

解析XML时出错:格式不正确(无效的令牌),而XML恰好很好

XML解析错误:格式不正确

错误:(3)错误:格式不正确(令牌无效)

Xamarin 解析 XML 时出错:格式不正确(令牌无效)

使用GPXPY解析gpx文件会导致格式不正确的无效令牌错误

收到错误“格式不正确(令牌无效)”

Android Studio错误格式不正确(令牌无效)

AAPT:错误:格式不正确(无效的令牌)

Python错误“格式不正确(无效令牌)”

尝试了解决方案,但没有解决错误:解析XML错误:格式不正确(无效的令牌)

osm2pgrouting-解析格式不正确的数据(无效的令牌)

xml.parsers.expat.ExpatError:格式不正确(无效的令牌)

Python-XML格式不正确(无效的令牌)调试值

xml.etree.ElementTree.ParseError:格式不正确(无效的令牌)

python-xml.etree.ElementTree.ParseError:格式不正确(无效的令牌)

android上的saxParser有错误(格式不正确(无效令牌))

元素树语法错误(格式不正确,令牌无效)

AAPT:错误:格式不正确(无效的令牌)错误弹出窗口,但没有明显的拼写错误

Jquery 加载函数在 firefox 中抛出“XML 解析错误:格式不正确”错误

无效的roslaunch XML语法:格式不正确的dji包