我正在尝试让谷歌地图v2工作在安卓使用安卓工作室。我拿到了我所有的钥匙和货单。当我尝试为映射将显示的实际活动创建xml时,我得到了错误。我的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"
tools:context=".MainActivity" >
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment"/>
</RelativeLayout>我在android studio中的错误如下所示:

发布于 2013-08-24 22:47:40
这也会发生在我身上。只需清理项目即可。
发布于 2014-08-25 06:51:24
您好,您必须在xml文件中使用以下代码:
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:name="com.google.android.gms.maps.SupportMapFragment"/>https://stackoverflow.com/questions/18419695
复制相似问题