[英]ERROR: File google-services.json is missing. (Since com.google.gms:google-services updated from 4.2.0 to 4.3.0)
Since I updated com.google.gms:google-services
from version 4.2.0 to 4.3.0 in my top level build.gradle, I cannot compile my project any more because I have the error :由于我在顶级 build.gradle 中将com.google.gms:google-services
从版本 4.2.0 更新为 4.3.0,因此我无法再编译我的项目,因为出现错误:
"File google-services.json is missing" “文件 google-services.json 丢失”
My google-services.json
are in :我的google-services.json
位于:
/My/personnal/project/app/src/ProductFlavors/BuildTypes
(for example) (例如)
/My/personnal/project/app/src/AT/debug
/My/personnal/project/app/src/DE/debug
/My/personnal/project/app/src/AT/release (...)
When my version is 4.2.0, I have no issue but in 4.3.0 I have the error and the Searched Location is: /My/personnal/project/app/google-services.json当我的版本为 4.2.0 时,我没有问题,但在 4.3.0 中出现错误,搜索位置为:/My/personnal/project/app/google-services.json
not working不工作
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.google.gms:google-services:4.3.0'
}
working在职的
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.google.gms:google-services:4.2.0'
}
EDIT 1编辑 1
Looks like it has been resolved with version 4.3.1貌似4.3.1版本已经解决了
EDIT 2编辑 2
Looks like issue is back on version 4.3.2 :(看起来问题又回到了 4.3.2 版:(
EDIT 3编辑 3
Issue still there with 4.3.3 :(问题仍然存在 4.3.3 :(
There is already an open issue on github based on this基于此,github上已经有一个未解决的问题
https://github.com/google/play-services-plugins/issues/91 https://github.com/google/play-services-plugins/issues/91
The problem is google-services plugin ignores the build variant if it starts with a capital letter.问题是 google-services 插件会忽略以大写字母开头的构建变体。
If you refactor the build variant names to camelCase, then it seems to detect the google-services.json file.如果您将构建变体名称重构为驼峰命名法,那么它似乎会检测到 google-services.json 文件。
Since I updated com.google.gms:google-services
from version 4.2.0 to 4.3.0 in my top level build.gradle, I cannot compile my project any more because I have the error :自从我在顶级build.gradle中将com.google.gms:google-services
从4.2.0版本更新为4.3.0以来,由于存在以下错误,我无法再编译项目:
"File google-services.json is missing" “缺少文件google-services.json”
My google-services.json
are in :我的google-services.json
位于:
/My/personnal/project/app/src/ProductFlavors/BuildTypes
(for example) (例如)
/My/personnal/project/app/src/AT/debug
/My/personnal/project/app/src/DE/debug
/My/personnal/project/app/src/AT/release (...)
When my version is 4.2.0, I have no issue but in 4.3.0 I have the error and the Searched Location is: /My/personnal/project/app/google-services.json当我的版本是4.2.0时,我没有问题,但是在4.3.0中,我出现了错误,并且“搜索位置”是:/My/personnal/project/app/google-services.json
not working不工作
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.google.gms:google-services:4.3.0'
}
working在职的
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.google.gms:google-services:4.2.0'
}
EDIT 1编辑1
Looks like it has been resolved with version 4.3.1看起来它已在4.3.1版中解决
EDIT 2编辑2
Looks like issue is back on version 4.3.2 :(看起来问题又回到了版本4.3.2 :(
EDIT 3编辑3
Issue still there with 4.3.3 :(问题仍然存在4.3.3 :(
将此行添加到应用程序 build.gradle 文件的底部,而不是顶部。
apply plugin: 'com.google.gms.google-services'
You need to get the configuration file from the developer's site and paste it in the app level directory of your project.您需要从开发者站点获取配置文件并将其粘贴到您项目的应用程序级目录中。 Generate file here developers.在这里开发人员生成文件。 google.com/mobile/add google.com/mobile/add
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.