【问题标题】:Firebase Version: 8.1.0 is lower than the minimum version (9.0.0) required for google-services pluginFirebase 版本:8.1.0 低于 google-services 插件所需的最低版本 (9.0.0)
【发布时间】:2017-06-01 14:09:01
【问题描述】:

我需要在 android 中向我的应用添加推送通知,但是当我添加时

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

我收到了这个错误

Error:(75, 0) Version: 8.1.0 is lower than the minimum version (9.0.0) required for google-services plugin.

这是我的 bulld.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.0"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 19
        versionCode 25
        versionName "2.4"
        multiDexEnabled true

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

repositories {
    maven { url "https://jitpack.io" }
}


dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    }) 
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.github.PhilJay:MPAndroidChart:v2.1.3'
    compile 'com.github.lzyzsd:circleprogress:1.1.0@aar'
    compile 'com.commit451:PhotoView:1.2.4'
    compile 'com.google.android.gms:play-services:8.1.0'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.daimajia.slider:library:1.1.5@aar'
    compile 'com.twotoasters.jazzylistview:library:1.2.1'
    compile 'com.twotoasters.jazzylistview:library-recyclerview:1.2.1'
    compile 'se.emilsjolander:stickylistheaders:2.7.0'
    compile 'com.squareup.retrofit2:retrofit:2.0.2'
    compile 'com.squareup.retrofit2:converter-gson:2.0.2'
    compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.0'
    compile 'me.nlmartian.silkcal:library:0.1.1'
    compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0'
    compile 'com.android.support:recyclerview-v7:21.1.0'
    compile 'com.pushbots:pushbots-lib:2.0.13@aar'
    compile 'com.android.support:support-v4:21.1.0'
    compile 'com.makeramen:roundedimageview:2.3.0'
    compile 'jp.wasabeef:blurry:2.1.1'
    compile 'com.google.firebase:firebase-messaging:10.0.1'
    testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

-

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

我试图用很多解决方案来解决这个问题,但我不能,所以如果有人可以帮助我,请回答!

【问题讨论】:

  • 你编译的依赖太多了。很少有非常过时的。

标签: android firebase firebase-notifications


【解决方案1】:

您需要根据 firebase 的要求更新您的播放服务,因此请使用高于或等于 9.0.0 的任何版本

所以替换这个

compile 'com.google.android.gms:play-services:8.1.0'

有了这个

compile 'com.google.android.gms:play-services:10.2.6'

并同步您的项目

错误:任务 ':app:processDebugGoogleServices' 执行失败。 > 文件 google-services.json 丢失。

为您的 Android 应用获取配置文件 要为 Android 应用下载配置文件:

按照以下步骤进行

  • 登录 Firebase 并打开您的项目。
  • 单击“设置”图标并选择“项目设置”。
  • 在您的应用卡中,从列表中选择您需要配置文件的应用的包名称。
  • 点击 google-services.json。

并复制google-services.json 文件并将其粘贴到您的项目的app 文件夹中

【讨论】:

  • 谢谢,在我添加这个并同步项目后,我得到了这个错误
  • 错误:任务 ':app:processDebugGoogleServices' 执行失败。 > 文件 google-services.json 丢失。没有它,Google 服务插件将无法运行。搜索位置:
  • 您需要从 firebase 项目设置中下载 google-services.json 文件并将其添加到项目的 app 文件夹中,因为该文件包含用于 firebase 验证的重要信息
  • 查看集成教程。你可能错过了一些步骤。 developers.google.com/android/guides/google-services-plugin
【解决方案2】:

检查您的 build.gradle 并更改它

compile 'com.google.android.gms:play-services:8.1.0'

到这里

compile 'com.google.android.gms:play-services:10.2.6'

或者更好 - 如果您唯一需要的是 Firebase 云消息传递,删除此导入

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-12-15
    • 2018-02-27
    • 2015-04-11
    • 2017-03-01
    • 1970-01-01
    • 2015-03-09
    • 1970-01-01
    相关资源
    最近更新 更多