android - 膨胀类 com.google.android.maps.MapView 时出错

标签 android google-maps map android-mapview inflate

我只是在学习一个简单的 map 教程http://developer.android.com/resources/tutorials/views/hello-mapview.html但得到这个错误。我是 android 新手,我试图遵循互联网上提供的所有解决方案,但还没有成功。请帮我。我的主要 .xml 在下面

<?xml version="1.0" encoding="utf-8"?>
<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="***"
/>

list 文件就是这个

最佳答案

我遇到了这个问题,通过以下两个步骤解决了:

1) 将以下行放入 AndroidManifest.xml 文件的 application(重要)元素中。

<uses-library android:name="com.google.android.maps" />

2) 扩展 MapActivity 而不是 Activity。

享受吧!

关于android - 膨胀类 com.google.android.maps.MapView 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6544979/

相关文章:

android - 无法从 onActivityReenter 中的 Intent 读取 Parcelable

google-maps - 谷歌地图显示状态线

google-maps - 如何在 Google Place URL 中获取 cid?

java - 如何从一张 map 中删除另一张 map 的元素?

C++ std::map,键的旋转

map - 创建 Openstreetmap 提取的 mbtiles 文件的最简单方法?

Android - 应用程序标签的 ResourceNotFoundException

android - 视频播放后返回应用

android - 谷歌眼镜 : menu and card font size styling

javascript - Google map 单击除 RichMarker 监听器之外的任何内容