找到 com.google.android.gms:play-services-gcm:8.3.0,但需要 8.1.0 版本
Found com.google.android.gms:play-services-gcm:8.3.0, but version 8.1.0 is needed
我刚刚在 Android SDK 管理器中将 Google 播放服务更新到最新版本 - 23。接下来,我将项目中的依赖项更新为:
com.google.android.gms:play-services-gcm:8.3.0
但是我得到了:
Found com.google.android.gms:play-services-gcm:8.3.0, but version 8.1.0 is needed
Found com.google.android.gms:play-services-gcm:8.3.0, but version 8.1.0 is needed
Found com.google.android.gms:play-services-gcm:8.3.0, but version 8.1.0 is needed
Found com.google.android.gms:play-services-gcm:8.3.0, but version 8.1.0 is needed
Found com.google.android.gms:play-services-gcm:8.3.0, but version 8.1.0 is needed
:app:processDebugGoogleServices FAILED
Error:Execution failed for task ':app:processDebugGoogleServices'.
> Please fix the version conflict.
怎么了?你也有这个问题吗?
在您的顶级 build.gradle 文件中,您需要更新依赖项才能使用
classpath 'com.google.gms:google-services:1.5.0-beta2'
额外信息:
可以通过查看 the entry on JFrog Bintray
找到最新版本
进一步更新:
是的,自从我回答了这个问题后,这已经更新了。最新版本是:
classpath 'com.google.gms:google-services:3.0.0'
但是,始终值得按照提供的 link 查找最新版本。
在您的顶级 build.gradle 文件中,您需要将依赖项更改为
classpath 'com.google.gms:google-services:+'
8.4.0 的工作解决方案(对于这个疯狂的问题,以前的版本可能也一样)
项目build.gradle:
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.google.gms:google-services:2.1.2'
}
app/mobile build.gradle
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'android-apt'
android {
...
...
...
}
dependencies {
// Google Play Services
compile 'com.google.android.gms:play-services-analytics:8.4.0'
// another play services in v8.4.0
}
apply plugin: 'com.google.gms.google-services' // why here on end? Because GOOGLE...
警告:
当您将 apply plugin: 'com.google.gms.google-services'
移动到构建 gradle 之上时,它无法编译...
Google Play Services 指南帮我解决了这个问题
根据指南,
In versions of Google Play services prior to 6.5, you had to compile the entire package of APIs into your app. In some cases, doing so made it more difficult to keep the number of methods in your app (including framework APIs, library methods, and your own code) under the 65,536 limit.
From version 6.5, you can instead selectively compile Google Play service APIs into your app. For example, to include only the Google Fit and Android Wear APIs, replace the following line in your build.gradle file:
compile 'com.google.android.gms:play-services:8.4.0'
这些行:
compile 'com.google.android.gms:play-services-fitness:8.4.0'
compile 'com.google.android.gms:play-services-wearable:8.4.0'
我也遇到了这个问题,虽然我的是
Found com.google.android.gms:play-services-gcm:8.4.0, but version
8.3.0 is needed
为了解决这个问题,我结合了 Jeff Sutton 和 mtrakal 的回答。我必须确保我在项目级 Gradle 文件中使用了最新的 Gradle 插件和 Google 服务版本(我有 Gradle 1.5 但它不起作用):
classpath 'com.google.gms:google-services:2.0.0-beta6'
classpath 'com.android.tools.build:gradle:2.0.0-beta6'
然后我将 apply plugin: 'com.google.gms.google-services'
行放在应用 Gradle 文件的最后一行。
我也遇到同样的冲突 com.google.android.gms:play-services-gcm:8.3.0 然后
我已经更新了google播放服务工具然后它已经解决了
从 SDK 管理器中选择工具并立即更新它解决
我刚刚在 Android SDK 管理器中将 Google 播放服务更新到最新版本 - 23。接下来,我将项目中的依赖项更新为:
com.google.android.gms:play-services-gcm:8.3.0
但是我得到了:
Found com.google.android.gms:play-services-gcm:8.3.0, but version 8.1.0 is needed
Found com.google.android.gms:play-services-gcm:8.3.0, but version 8.1.0 is needed
Found com.google.android.gms:play-services-gcm:8.3.0, but version 8.1.0 is needed
Found com.google.android.gms:play-services-gcm:8.3.0, but version 8.1.0 is needed
Found com.google.android.gms:play-services-gcm:8.3.0, but version 8.1.0 is needed
:app:processDebugGoogleServices FAILED
Error:Execution failed for task ':app:processDebugGoogleServices'.
> Please fix the version conflict.
怎么了?你也有这个问题吗?
在您的顶级 build.gradle 文件中,您需要更新依赖项才能使用
classpath 'com.google.gms:google-services:1.5.0-beta2'
额外信息: 可以通过查看 the entry on JFrog Bintray
找到最新版本进一步更新: 是的,自从我回答了这个问题后,这已经更新了。最新版本是:
classpath 'com.google.gms:google-services:3.0.0'
但是,始终值得按照提供的 link 查找最新版本。
在您的顶级 build.gradle 文件中,您需要将依赖项更改为
classpath 'com.google.gms:google-services:+'
8.4.0 的工作解决方案(对于这个疯狂的问题,以前的版本可能也一样)
项目build.gradle:
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.google.gms:google-services:2.1.2'
}
app/mobile build.gradle
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'android-apt'
android {
...
...
...
}
dependencies {
// Google Play Services
compile 'com.google.android.gms:play-services-analytics:8.4.0'
// another play services in v8.4.0
}
apply plugin: 'com.google.gms.google-services' // why here on end? Because GOOGLE...
警告:
当您将 apply plugin: 'com.google.gms.google-services'
移动到构建 gradle 之上时,它无法编译...
Google Play Services 指南帮我解决了这个问题
根据指南,
In versions of Google Play services prior to 6.5, you had to compile the entire package of APIs into your app. In some cases, doing so made it more difficult to keep the number of methods in your app (including framework APIs, library methods, and your own code) under the 65,536 limit.
From version 6.5, you can instead selectively compile Google Play service APIs into your app. For example, to include only the Google Fit and Android Wear APIs, replace the following line in your build.gradle file:
compile 'com.google.android.gms:play-services:8.4.0'
这些行:
compile 'com.google.android.gms:play-services-fitness:8.4.0'
compile 'com.google.android.gms:play-services-wearable:8.4.0'
我也遇到了这个问题,虽然我的是
Found com.google.android.gms:play-services-gcm:8.4.0, but version 8.3.0 is needed
为了解决这个问题,我结合了 Jeff Sutton 和 mtrakal 的回答。我必须确保我在项目级 Gradle 文件中使用了最新的 Gradle 插件和 Google 服务版本(我有 Gradle 1.5 但它不起作用):
classpath 'com.google.gms:google-services:2.0.0-beta6'
classpath 'com.android.tools.build:gradle:2.0.0-beta6'
然后我将 apply plugin: 'com.google.gms.google-services'
行放在应用 Gradle 文件的最后一行。
我也遇到同样的冲突 com.google.android.gms:play-services-gcm:8.3.0 然后
我已经更新了google播放服务工具然后它已经解决了
从 SDK 管理器中选择工具并立即更新它解决