错误"请通过更新google-services插件的版本来修复版本冲突

时间:2016-09-14 14:56:07

标签: android android-gradle build.gradle firebase-cloud-messaging

我尝试在我的应用中使用Firebase云消息传递,我收到此错误:

buildscript {
    repositories {
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.3'
        classpath 'com.google.gms:google-services:3.0.0'  

    }
}

allprojects {
    repositories {
        jcenter()
        mavenLocal()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
  

请通过更新google-services插件的版本(HTTPServletRequest提供有关最新版本的信息)或将com.google.android.gms的版本更新为9.0.0来修复版本冲突

我的项目gradle:

 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 "23.0.3"

    defaultConfig {
        applicationId "com.nashkvartal"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
        transitive = true;
    }
    compile 'com.android.support:appcompat-v7:24.2.0'
    compile 'com.android.support:design:24.2.0'
    compile 'com.android.support:support-v4:24.2.0'
    compile 'com.loopj.android:android-async-http:1.4.9'
    compile 'com.google.code.gson:gson:2.6.1'
    compile 'com.facebook.android:facebook-android-sdk:4.+'
    compile 'com.vk:androidsdk:+'
    compile 'com.google.android.gms:play-services-auth:9.4.0'
    compile 'com.roughike:bottom-bar:1.3.3'
    compile 'com.google.android.gms:play-services-appindexing:9.4.0'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
}

我的模块gradle:

request

如何解决错误?

1 个答案:

答案 0 :(得分:1)

正如错误所述,请在模块gradle中将版本降级到9.0.0,并希望它可以正常工作:

compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.support:design:24.2.0'
compile 'com.android.support:support-v4:24.2.0'
compile 'com.loopj.android:android-async-http:1.4.9'
compile 'com.google.code.gson:gson:2.6.1'
compile 'com.facebook.android:facebook-android-sdk:4.+'
compile 'com.vk:androidsdk:+'
  

编译'com.google.android.gms:play-services-auth:9.0.0'

compile 'com.roughike:bottom-bar:1.3.3'
  

编译'com.google.android.gms:play-services-appindexing:9.0.0'

compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'