Getting "File google-services.json is missing" when trying to use use different json files based on the build type

huangapple go评论52阅读模式
英文:

Getting "File google-services.json is missing" when trying to use use different json files based on the build type

问题

在Android上,我试图将不同的google-service.json文件添加到特定的构建文件夹中:

/app/src/prod/google-service.json

/app/src/stage/google-service.json

在我的gradle中,我添加了apply plugin: 'com.google.gms.google-services',根据Firebase文档1的说明。

问题是,我收到“文件丢失错误”的消息,因为它说这些位置(例如/app/src/prod)不在搜索位置列表的一部分,我从列表中看到了这一点。如何使它将prod文件夹作为搜索位置的一部分?

英文:

On Android, I'm trying to add different google-service.json files to specific build folder:

/app/src/prod/google-service.json

/app/src/stage/google-service.json

In my gradle, I added apply plugin: 'com.google.gms.google-services', as per the Firebase doc.

The problem is that I get the "File missing error", because it says that those locations (Ex. /app/src/prod) is not part of the searched locations list, which I've seen from the list. How can I make it have that prod folder a part of the searched locations?

答案1

得分: 1

你是否将你的文件命名为 google-service.json

如果是这样,请尝试将它们重命名为 google-services.json(注意 "service" 这个词变为复数形式),然后查看是否有效。

英文:

Did you name your files google-service.json?

If so, try renaming them to google-services.json (note the pluralization of "service") and see if that works.

huangapple
  • 本文由 发表于 2023年2月14日 00:03:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/75438344.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定