【发布时间】:2013-12-03 09:22:53
【问题描述】:
我已经看过几个关于这个问题的帖子,但我无法解决它。
当我尝试运行 MapView 时出现此错误
12-03 10:26:20.865: E/AndroidRuntime(3317): java.lang.IllegalStateException: The meta-
data tag in your app's AndroidManifest.xml does not have the right value.
Expected 4030500 but found 0. You must have the following declaration within the
<application> element: <meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
我已将此添加到我的清单中
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<meta-data
android:name="com.google.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.v2.API_KEY"
android:value="API_KEY" />
我也试过这个
<meta-data
android:name="com.google.gms.version"
android:value="4030500"
/>
在 google play services 库中的清单:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.android.gms"
android:versionCode="4030530"
android:versionName="4.0.30 (889083-30)" >
<uses-sdk android:minSdkVersion="8"/>
</manifest>
我不知道为什么它对我不起作用。
我正在使用 HTC Sensation android 4.0.3 版本作为我的模拟器。
【问题讨论】:
-
看这里:stackoverflow.com/questions/20261305/…你在应用部分设置了版本标签吗?另外,请发布您的完整 logcat。谢谢。
-
这是 Google Play 服务的版本号。从该版本开始,必须在清单中指定您想在应用程序中使用的库版本。
-
添加了更多信息。
-
查看错误,然后查看清单中的内容,它显然不匹配
标签: android google-maps android-mapview