我在使用 Google 登录和 Google Play 服务时遇到了一个奇怪的问题。
我按照此处的说明进行操作 https://developers.google.com/identity/sign-in/android/start-integrating并将 'com.google.gms:google-services:1.5.0-beta2'
添加到我的 build.gradle 文件中。
然后我在应用程序的 gradle 文件中添加了我们的应用程序所需的这些播放服务库:
编译 'com.google.android.gms:play-services-location:8.4.0'
编译 'com.google.android.gms:play-services-maps:8.4.0'
编译 'com.google.android.gms:play-services-fitness:8.4.0'
编译 'com.google.android.gms:play-services-analytics:8.4.0'
编译 'com.google.android.gms:play-services-auth:8.4.0'
但是当我编译时出现这个错误:
What went wrong: Execution failed for task ':app:processDebugGoogleServices'. Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 8.3.0.
Found com.google.android.gms:play-services-fitness:8.4.0, but version 8.3.0 is needed for the google-services plugin.
让我感到困惑的是,开发人员文档说要使用 1.5.0-beta2 版插件和 8.4 版播放服务,但 gradle 不会让我编译。
最佳答案
这里的帖子有答案Version conflict updating to 8.4.0
我需要两件事,
类路径 'com.android.tools.build:gradle:2.0.0-alpha5'
类路径 'com.google.gms:google-services:2.0.0-alpha5'
并将 apply plugin: 'com.google.gms.google-services'
移动到文件末尾
关于Android - Google 登录和 Play 服务版本不兼容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34801520/