簡體   English   中英

Android錯誤解析XML:格式不正確

[英]Android Error parsing XML: not well-formed

我有一個錯誤:解析XML:我的activity_main.xml文件中格式不正確(無效的令牌)出錯,我無法弄清楚它到底是什么。 我已經嘗試過重新鍵入它,以確保與引號無關。 我幾乎是從一本書中復制代碼。 代碼是:

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

<com.google.android.maps.MapView
    android:id="@+id/mapView"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:enabled="true"
    android:clickable="true"
    android:apiKey="0ak81Gwf6w8ZZhWxdNiCS8e6LvqrrwZ8nUZKmbQ" />
</LinearLayout>

更改為此:

<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

<com.google.android.maps.MapView
    android:id="@+id/mapView"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:enabled="true"
    android:clickable="true"
    android:apiKey="0ak81Gwf6w8ZZhWxdNiCS8e6LvqrrwZ8nUZKmbQ" />
</LinearLayout>

您沒有關閉LinearLayout起始標簽。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM