解析XML时出错(一些恼人的问题,初学者)(Error parsing XML (Some annoying issue, beginner))

我一直在寻找关于那个错误的先前主题,他们说我应该首先列出android:xmlns attirbute,这就是我所做的但是我仍然面临着这个错误,不明白为什么。 (如果我从工作中复制另一个布局并不重要)。 无论如何,这是XML:

<RelativeLayout 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" > <com.google.android.maps.MapView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/mapview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:clickable="true" android:apiKey="*CENSORED*"/> </RelativeLayout>

这可能是什么问题?

I've been looking in the previous subjects about that error, they said that I should list the android:xmlns attirbute first, that's what I've done but I'm still facing that error, no idea why. (It doesn't matter if I copy another layout from a working one). Here's the XML anyway:

<RelativeLayout 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" > <com.google.android.maps.MapView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/mapview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:clickable="true" android:apiKey="*CENSORED*"/> </RelativeLayout>

What could be the problem here?

最满意答案

<?xml version="1.0" encoding="utf-8"?> <RelativeLayout 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 xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/mapview" android:layout_width="fill_parent" android:layout_height="wrap_content" android:clickable="true" android:layout_above="@+id/ll" android:apiKey="*******" /> </RelativeLayout>

这是我的xml,它适用于我。 我想你错过了第一线。

The solution is: Had to reset my adb..

更多推荐