【问题标题】:File google-services.json is missing文件 google-services.json 丢失
【发布时间】:2018-04-17 19:21:54
【问题描述】:

我遇到了这个错误:

org.gradle.api.GradleException: File google-services.json is missing. The 
Google Services Plugin cannot function without it. 

我希望有人帮助我,我几乎尝试了所有方法,但我失败了!!


注意:请确保我已下载“google-services.json”,然后将其放入 MyProjectName/app


这是我项目的构建 gradle(project):

buildscript {

repositories {
    google()
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.1.1'
    classpath 'com.google.gms:google-services:3.2.0'
    classpath 'com.google.firebase:firebase-plugins:1.0.4'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

allprojects {
repositories {
    google()
    jcenter()
    maven {
        url "https://maven.google.com"
    }

}
}

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

【问题讨论】:

  • 确保您已从使用当前包名注册的项目中下载了 google-services.json
  • 我确定,我在那里输入了我的包名
  • 您的问题解决了吗?

标签: android android-studio android-gradle-plugin build.gradle android-sdk-2.3


【解决方案1】:

Firebase 控制台 中,您必须导航到您的 项目设置 并在连接的 Android 中选择 google-services.json应用程序

您必须将此文件放入项目目录中的app 目录中。

【讨论】:

  • 我已经这样做了!!...我将 google-services.json 放入了我的“应用”目录
  • 让我的应用程序的密钥与 google-services.json 文件中的密钥相同(当前密钥)???
  • @osamaastal 我也有同样的问题!该文件在我的应用程序目录中。如果我降级颤振它会起作用,但是我会遇到其他问题,这就是我想首先升级的原因!
猜你喜欢
  • 1970-01-01
  • 2016-10-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-05-18
  • 1970-01-01
  • 2019-11-30
  • 1970-01-01
相关资源
最近更新 更多