模块根文件夹中缺少文件google-services.json

时间:2016-04-14 05:32:45

标签: android gradle google-play-services

在我的build.gradle中:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.0.0'
        classpath 'com.google.gms:google-services:2.0.0'
    }
}
apply plugin: 'com.android.application'

android {
   ...
}
apply plugin: 'com.google.gms.google-services' // This is the last line

我试图将google-services.json放在:

+ build.gradle
+ app
  + google-services.json
+ src
  + app
    + google-services.json
  + main
    + app
      + google-service.json

google-services插件未检测到这些json文件。它只是告诉File google-services.json is missing from module root folder. The Google Services Plugin cannot function without it.

我应该如何配置我的gradle脚本?我应该把json文件放在哪里?

1 个答案:

答案 0 :(得分:0)

google-services.json需要在app文件夹中添加。