英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论