错误膨胀类 com.google.android.maps.MapView [英] Error Inflating class com.google.android.maps.MapView
问题描述
我只是在学习一个简单的地图教程 http://developer.android.com/resources/tutorials/views/hello-mapview.html 但收到此错误.我是 android 新手,我尝试遵循互联网上提供的所有解决方案,但尚未成功.请帮我.我的主要 .xml 在下面
i am just following a simple map tutorial http://developer.android.com/resources/tutorials/views/hello-mapview.html but getting this error . I am new to android i tried to follow all the solution provided over the internet but no success yet. Please help me. My main .xml is below
<?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="***"
/>
清单文件就是这个
推荐答案
我遇到了这个问题,并通过以下 2 个步骤解决了:
I had this problem and solved it by the following 2 steps:
1) 将以下行放入 AndroidManifest.xml 文件的 application(重要)元素中.
1) Put the following line in the application (important) element of AndroidManifest.xml file.
<uses-library android:name="com.google.android.maps" />
2) 扩展 MapActivity 而不是 Activity.
2) extend MapActivity instead of Activity.
享受吧!
这篇关于错误膨胀类 com.google.android.maps.MapView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!