谷歌地图API V2,和谷歌播放服务的lib旧版本 [英] google map api v2, and older version of google play services lib

查看:226
本文介绍了谷歌地图API V2,和谷歌播放服务的lib旧版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要在我的Andr​​oid应用程序中使用的地图,我应该使用谷歌播放服务。我阅读了大量的Q \一这里像<一个href="http://stackoverflow.com/questions/19733649/app-wont-run-unless-you-update-google-play-services-with-google-maps-api">this.在提到的问题,接受的答案suggets使用谷歌的旧版本播放服务的lib,就像一个为Froyo的。我下载了谷歌播放服务R10和我的应用程序中使用它,但我得到的错误。

如果我排除该行code的清单:

 &LT;元数据
    机器人:名称=com.google.android.gms.version
    机器人:值=@整数/ google_play_services_version/&GT;
 

在我的设备上运行的应用程序(的谷歌FLASH播放器服务我的设备目前的版本是66年2月3日),它抛出错误:

  java.lang.IllegalStateException:在您的应用程序的Andr​​oidManifest.xml中的元数据标签没有正确的价值。预计4030500但发现0。你必须在&lt中的以下声明;用途&gt;元:其中,元数据的android:NAME =com.google.android.gms.version机器人:值=@整数/ google_play_services_version/&GT;
 

如果我与Android包括它:值= 4030500应用程序运行,但说,前人的精力我更新我的谷歌播放服务

所以,我应该把安卓?数值或我是正确的方式在所有

问候

解决方案
  

我下载了谷歌播放服务,R10和我的应用程序中使用它

上面的语句是你的问题的根本原因。如果你真的使用R10(甚至R12),不是删除后

 &LT;元数据
    机器人:名称=com.google.android.gms.version
    机器人:值=@整数/ google_play_services_version/&GT;
 

从AndroidManifest,你就不会得到这个错误:

  java.lang.IllegalStateException:在您的应用程序的Andr​​oidManifest.xml中的元数据标签没有正确的价值。预计4030500但发现0。你必须在&lt中的以下声明;用途&gt;元:其中,元数据的android:NAME =com.google.android.gms.version机器人:值=@整数/ google_play_services_version/&GT;
 

此错误只是说,你链接到4.0.30版本的谷歌游戏服务库。

因此​​,解决方法是删除上述的元数据,并确保您链接到previous版本之一。

如果使用摇篮或Maven,只需要设置你的依赖版本,以65年3月2日。如果开发旧的方式,下载谷歌在Android的SDK管理器中播放服务,为Froyo的,复制从 SDK /演员/谷歌/ 到工作目录,并在您的项目preferences选择这个项目作为一个库相关的项目。

I am going to use maps in my android application and I should use google play services. I read lots of q\a here like this. In the mentioned question, the accepted answers suggets using older version of google play services lib, like the one for Froyo. I downloaded google play services r10 and used it in my app, but I got errors.

If I exclude this line of code from manifest:

<meta-data
    android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" />

and run the app in my device (current version of google playe services in my device is 3.2.66 ), it throws error:

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" />

and if I include it with android:value=4030500 the app runs but says that I sould update my "google play services".

So what should I put android:value or Is my way correct at all ?

Regards

解决方案

I downloaded google play services r10 and used it in my app

The above statement is the root cause of your problems. If you really used r10 (or even r12), than after removing

<meta-data
    android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" />

from your AndroidManifest, you would not get this error:

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" />

This error simply says, you are linked to 4.0.30 version of the Google Play services library.

So the solution is to remove the above meta-data and making sure you link to one of the previous versions.

If using gradle or maven, just set your dependency version to 3.2.65. If developing the old way, download Google Play services for Froyo in Android SDK Manager, copy that from sdk/extras/google/ into your working directory and in your project preferences choose this project as a library dependency project.

这篇关于谷歌地图API V2,和谷歌播放服务的lib旧版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆