如何确定 Google Play 服务的版本? [英] How can I determine the version of Google Play services?

查看:67
本文介绍了如何确定 Google Play 服务的版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从 Eclipse 迁移到 Android Studio.我有一个项目,我导入到使用 Google Play 服务的 Android Studio,所以我遵循我在这里找到的文档:http://developer.android.com/google/play-services/setup.html这个文档说我需要编辑我的 build.gradle 文件.他们举了个例子:

I am migrating from Eclipse to Android Studio. I have a project that I imported into Android Studio that uses Google Play Services, so I am following the documentation I found here: http://developer.android.com/google/play-services/setup.html This documentation says that I need to edit my build.gradle file. They give the example:

apply plugin: 'com.android.application'
...

dependencies {
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile 'com.google.android.gms:play-services:6.5.87'
}

文档还提到,每次更新 Google Play 服务时,请确保更新此版本号.",我假设在上面的示例中是 6.5.87.那么我如何确定我用我的 Android SDK 管理器安装的版本"Google Play 服务.这是我的 android sdk 的屏幕截图:

Also the documentation mentions, "Be sure you update this version number each time Google Play services is updated.", which I assume is 6.5.87 in the above example. So how do I determine the "version" Google Play Services I have installed with my Android SDK manager. Here is a screen shot of my android sdk:

所以我的 Android SDK 管理器告诉我我已经安装了修订版" 那么我应该在我的 build.gradle 文件中放什么?

So my Android SDK Manager tells me I have installed "Revision" so what do I put in my build.gradle file?

    compile 'com.google.android.gms:play-services:6.5.22'

...或者也许...

    compile 'com.google.android.gms:play-services:22'

感谢任何帮助!

更新:感谢您的所有回答.

UPDATE: Thank you for all your answers.

我能够找到这样的版本:

I was able to find the version like so:

Leila001@win8 ~/Windows_Home/AppData/Local/Android/android-sdk/extras/google/google_play_services/libproject/google-play-services_lib/res/values
$ cat version.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <integer name="google_play_services_version">6587000</integer>
</resources>

推荐答案

通过检查以确保您没有任何更新,您的想法是正确的.

You have the right idea by checking to make sure you do not have any updates.

最简单的检查方法是当您在 Android SDK(本地)中下载最新版本时.

The easiest way to check is simply when you have the latest downloaded in the Android SDK(locally).

我使用的是 Mac OSX:

I am using Mac OSX:

~/android-sdk/extras/google/m2repository/com/google/android/gms/play-services/

如果您查看 YOUR-ANDROID-SDK/extras/google/m2repository/com/google/android/gms/play-services/ 的位置,您将看到您下载的所有版本有.

If you look where you have YOUR-ANDROID-SDK/extras/google/m2repository/com/google/android/gms/play-services/, you will see all the versions downloaded that you have.

最新的是6.5.87.(编译'com.google.android.gms:play-services:6.5.87')

对于您来说,Windows 上的目录路径为:

For you, the directory path on Windows would be:

C:\Users\Leila001\AppData\Local\Android\extras\google\m2repository\com\google\android\gms\play-services

这篇关于如何确定 Google Play 服务的版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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