版本冲突更新为播放服务9.4.0 Android studio 2.2 [英] Version conflict updating to play-services 9.4.0 Android studio 2.2
问题描述
我收到一个错误消息:
错误:任务':app:processDebugGoogleServices'的执行失败。
>请通过更新google-services插件的版本来修复版本冲突(有关最新版本的信息,请访问https://bintray.com/android/android-tools/com.google.gms.google-services/)或将com.google.android.gms的版本更新为9.0.0。
我试着看 https://bintray.com/android/android-tools/com.google.gms.google-services/ 和com.google.gms:google - 服务:3.0.0似乎是最新的。这是我的项目gradle
依赖关系{
classpath'com.android.tools.build:gradle:2.1.2 '
classpath'com.google.gms:google-services:3.0.0'
//注意:不要在这里放置您的应用程序依赖关系;它们属于单个模块build.gradle文件
//
$ b $ /这就是我的应用程序gradle的样子 buildscript {
repositories {
maven {url'https ://maven.fabric.io/public'}
}
依赖关系{
classpath'io.fabric.tools:gradle:1.+'
}
}
apply plugin:'com.android.application'
apply plugin:'io.fabric'
apply plugin:'com.google.gms.google-services'
知识库{
maven {url'https://maven.fabric.io/public'}
}
android {
compileSdkVersion 24
buildToolsVersion24.0.1
useLibrary'org.apache.http.legacy'
defaultConfig {
applicationIdcom.myapp.preburn
minSdkVersion 10
targetSdkV ersion 24
versionCode 14
versionName2.0.1
renderscriptTargetApi 22
renderscriptSupportModeEnabled true
}
buildTypes {
release {
lintOptions {
disable'MissingTranslation'
}
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
$ b android {
packagingOptions {
排除'META-INF / DEPENDENCIES'
排除'META-INF / NOTICE'
排除'META-INF / LICENSE'
}
}
储存库{
mavenCentral()
jcenter()
}
依赖关系{
编译fileTree(dir:'libs',include:['* .jar'])
编译fileTree(dir:'libs',包括:'Parse - *。jar')
编译'com.parse.bolts:bolts-android:1.2.0'
compile'com.android.support: appcompat-v7:24.1.1'
compile'com.mcxiaoke.volley:library:1.0.9'
compile'com.google.android.gms:play-services-gcm:9.4.0'
compile'com.google.android.gms:play-services-location:9.4.0'
compile'com.google.android.gms:play-services-maps:9.4.0'
compile'com.google.android.gms:play-services-ads:9.4.0'
compile'com.google.android.gms:play-services-plus:9.4.0'
编译'com.google.android.gms:play-services-analytics:9.4.0'
compile'me.leolin:ShortcutBadger:1.1.3@aar'
compile'com.squareup.picasso: picasso:2.5.2'
编译文件('libs / jsoup-1.7.3.jar')
compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar'){
transitive = true; ('libs / InMobi-5.2.2.jar')
编译文件('libs / libadapterinmobi.jar')
编译文件('libs / StartAppAdMobMediation -1.0.1.jar')
编译文件('libs / StartAppInApp-3.3.1.jar')
编译'org.adw.library:discrete-seekbar:1.0.1'
编译'com.pnikosis:materialish-progress:1.0'
}
如果我改变播放服务到9.0.0一切都编译好。我在这里错过了什么?
解决方案您需要将 apply插件:'com.google。 gms.google-services'
行在依赖关系
块下面 - 这允许插件确定您使用的Play服务的版本。
I get an error saying
Error: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 9.0.0.
I tried looking at https://bintray.com/android/android-tools/com.google.gms.google-services/ and com.google.gms:google-services:3.0.0 seems to be the latest. This is my project gradle
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
And this is how my app gradle looks like
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.myapp.preburn"
minSdkVersion 10
targetSdkVersion 24
versionCode 14
versionName "2.0.1"
renderscriptTargetApi 22
renderscriptSupportModeEnabled true
}
buildTypes {
release {
lintOptions {
disable 'MissingTranslation'
}
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
android {
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
}
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(dir: 'libs', include: 'Parse-*.jar')
compile 'com.parse.bolts:bolts-android:1.2.0'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.mcxiaoke.volley:library:1.0.9'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile 'com.google.android.gms:play-services-location:9.4.0'
compile 'com.google.android.gms:play-services-maps:9.4.0'
compile 'com.google.android.gms:play-services-ads:9.4.0'
compile 'com.google.android.gms:play-services-plus:9.4.0'
compile 'com.google.android.gms:play-services-analytics:9.4.0'
compile 'me.leolin:ShortcutBadger:1.1.3@aar'
compile 'com.squareup.picasso:picasso:2.5.2'
compile files('libs/jsoup-1.7.3.jar')
compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
transitive = true;
}
compile files('libs/InMobi-5.2.2.jar')
compile files('libs/libadapterinmobi.jar')
compile files('libs/StartAppAdMobMediation-1.0.1.jar')
compile files('libs/StartAppInApp-3.3.1.jar')
compile 'org.adw.library:discrete-seekbar:1.0.1'
compile 'com.pnikosis:materialish-progress:1.0'
}
If I change the play services to 9.0.0 everything compiles fine. What am I missing here?
解决方案 You need to put the apply plugin: 'com.google.gms.google-services'
line below your dependencies
block - this allows the plugin to determine what version of Play services you are using.
这篇关于版本冲突更新为播放服务9.4.0 Android studio 2.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!