Google Android Studio 的 Play 服务版本
Google Play Services Version for Android Studio
我正在从 Eclipse 切换到 Android Studio。在 Eclipse 中将 GPServices 添加到我的项目中非常简单。只需确保在 SDK 管理器中安装了最新的 SDK,并将库从 SDK 包复制到我的工作区。
使用 AS,我必须在我的模块中输入以下行
build.gradle:
compile 'com.google.android.gms:play-services:6.5.87
我怎么知道 6.5.87 是正确的版本?我的 SDK 管理员说我有 Google Play Services Rev. 22。22 看起来与 6.5.87 不同。
我从一些没有解释其含义的文档中得到 6.5.87。
有人可以阐明这个问题吗?
在 Android Studio 中,您需要从 SDK Manager 下载 Google Repository
以获得 Eclipse 中 Google Play Services
的等效项。并检查 YOUR_ANDROID_SDK_PATH\extras\google\m2repository\com\google\android\gms\play-services
,您将能够看到您可以使用哪些版本。
与其猜测要添加到 build.gradle 的哪个版本,或检查 http://gradleplease.appspot.com(我发现该网站已过时),不如执行以下操作:
- 转到文件 -> 项目结构 -> 应用程序 -> 依赖项选项卡。
- 单击“+”-> 库依赖项
- 搜索 com.google.android.gms
- Select com.google.android.gms:play-services:CurrentVersion
- 单击“确定”。
- 为项目结构单击“确定”window。
我正在从 Eclipse 切换到 Android Studio。在 Eclipse 中将 GPServices 添加到我的项目中非常简单。只需确保在 SDK 管理器中安装了最新的 SDK,并将库从 SDK 包复制到我的工作区。
使用 AS,我必须在我的模块中输入以下行 build.gradle:
compile 'com.google.android.gms:play-services:6.5.87
我怎么知道 6.5.87 是正确的版本?我的 SDK 管理员说我有 Google Play Services Rev. 22。22 看起来与 6.5.87 不同。
我从一些没有解释其含义的文档中得到 6.5.87。
有人可以阐明这个问题吗?
在 Android Studio 中,您需要从 SDK Manager 下载 Google Repository
以获得 Eclipse 中 Google Play Services
的等效项。并检查 YOUR_ANDROID_SDK_PATH\extras\google\m2repository\com\google\android\gms\play-services
,您将能够看到您可以使用哪些版本。
与其猜测要添加到 build.gradle 的哪个版本,或检查 http://gradleplease.appspot.com(我发现该网站已过时),不如执行以下操作:
- 转到文件 -> 项目结构 -> 应用程序 -> 依赖项选项卡。
- 单击“+”-> 库依赖项
- 搜索 com.google.android.gms
- Select com.google.android.gms:play-services:CurrentVersion
- 单击“确定”。
- 为项目结构单击“确定”window。