解决方法:版本:7.8.0低于google-services插件所需的最低版本(9.0.0)

时间:2019-03-30 09:07:50

标签: android firebase firebase-cloud-messaging google-play-services

我正在Android Studio上开发应用程序,但是当我尝试运行Firebase FCM sdk时, 我收到消息:版本:7.8.0低于google-services插件所需的最低版本(9.0.0)。

我该如何解决?

我的build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    useLibrary 'org.apache.http.legacy'

    defaultConfig {
        applicationId "com.example.test"
        minSdkVersion 9
        targetSdkVersion 20
        versionCode 10096
        versionName "1.0.9.6"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    // Fixes "Duplicate files copied in APK" build bug
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
    }
}
dependencies {

    // Pushy SDK
    implementation 'com.google.firebase:firebase-messaging:11.8.0'
    compile 'me.pushy:sdk:1.0.43'

    // AppCompat v7 Dependency
    compile 'com.android.support:appcompat-v7:23.4.0'

    // Google Play Services Dependencies
    compile 'com.google.android.gms:play-services-location:7.8.0'

    // All .jar files in ./libs
    compile fileTree(dir: 'libs', include: ['*.jar'])
}

apply plugin: 'com.google.gms.google-services'

和我的build.gradle-master:

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'

        classpath 'com.google.gms:google-services:3.1.1'
    }
}

allprojects {
    repositories {
        jcenter()
        google()
    }
}

谢谢您的帮助。

1 个答案:

答案 0 :(得分:0)

如错误日志所述,您应该在build.gradle中更改版本。

    // Google Play Services Dependencies
    compile 'com.google.android.gms:play-services-location:9.0.0'