Gradle警告:在浏览时找不到google-services.json [英] Gradle Warnings: Could not find google-services.json while looking in
问题描述
我收到以下警告. 如何避免出现此警告?
I got the following warnings. How can I avoid this warnings?
在浏览时找不到google-services.json [src/flavor1/debug,src/debug,src/flavor1]找不到 google-services.json,同时查看[src/flavor1/release, src/release,src/flavor1]时找不到google-services.json 找不到[src/flavor2/debug,src/debug,src/flavor2] google-services.json,同时查看[src/flavor2/release, src/release,src/flavor2]
Could not find google-services.json while looking in [src/flavor1/debug, src/debug, src/flavor1] Could not find google-services.json while looking in [src/flavor1/release, src/release, src/flavor1] Could not find google-services.json while looking in [src/flavor2/debug, src/debug, src/flavor2] Could not find google-services.json while looking in [src/flavor2/release, src/release, src/flavor2]
我在 app/google-services.json
{
"project_info": {
"project_number": "000000000000",
"project_id": "****-*****"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": ...,
"android_client_info": {
"package_name": "flavor1.package.name"
}
},
...
},
{
"client_info": {
"mobilesdk_app_id": ...,
"android_client_info": {
"package_name": "flavor2.package.name"
}
},
...
}
],
"configuration_version": "1"
}
推荐答案
根据我的经验,当您使用与Firebase相关的任何类型的服务并且没有将google-services.json
文件放入我们需要的文件时,就会发生这种情况使用服务,
As per my experience, this will occur when you are using any type of service related to firebase and you have not put the google-services.json
the file which we needed to use the service,
解决方案是,您需要从Firebase控制台获取文件,并且如果要在控制台中为所有风味创建单个项目,则需要将其放置在应用程序级别文件夹中;如果要创建其他项目,则需要为许多项目或口味创建许多文件.
The solution is you need to get the file from firebase console and you need to put inside of your app level folder if you are creating a single project in the console for all flavor and If you are creating different one then you need to create a number of files for a number of projects or flavors.
这篇关于Gradle警告:在浏览时找不到google-services.json的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!