Bab*_*loo 7 android google-maps google-play
我将在我的Android应用程序中使用地图,我应该使用谷歌播放服务.我阅读了大量的Q \这里一个像这样.在上面提到的问题中,接受的答案建议使用旧版本的google play服务lib,就像Froyo那样.我下载了谷歌播放服务r10并在我的应用程序中使用它,但我收到了错误.
如果我从清单中排除这行代码:
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
Run Code Online (Sandbox Code Playgroud)
并在我的设备中运行应用程序(我的设备中当前版本的google playe服务是3.2.66),它会抛出错误:
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" />
Run Code Online (Sandbox Code Playgroud)
如果我用android:value = 4030500包含它,该应用程序运行,但说我应该更新我的"谷歌播放服务".
那么我应该把android:value或者我的方法完全正确呢?
问候
我下载了 google play services r10 并在我的应用程序中使用它
上述陈述是您问题的根本原因。如果您确实使用了 r10(甚至 r12),那么删除后
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
Run Code Online (Sandbox Code Playgroud)
从您的 AndroidManifest 中,您不会收到此错误:
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" />
Run Code Online (Sandbox Code Playgroud)
此错误只是表明,您已链接到 4.0.30 版本的 Google Play 服务库。
因此,解决方案是删除上述内容meta-data并确保链接到以前的版本之一。
如果使用 gradle 或 maven,只需将依赖版本设置为 3.2.65。如果使用旧方法进行开发,请在 Android SDK Manager 中下载适用于 Froyo 的 Google Play 服务,将其复制sdk/extras/google/到您的工作目录中,然后在您的项目首选项中选择该项目作为库依赖项项目。
| 归档时间: |
|
| 查看次数: |
7969 次 |
| 最近记录: |