英文:
Project ID Required to Access Firestore Error
问题
我希望使用Firebase Admin SDK,但出现了一个“需要项目ID才能访问Firestore错误”的问题。
我从Firebase控制台下载了一个admin-sdk的JSON文件,并将其放在调用它的文件的同一目录中。
opt := option.WithCredentialsFile("../<FILENAME>.json")
凭据文件中包含了项目ID,但由于某种原因,opt
变量无法从凭据文件中提取数据,因此在尝试获取Firestore客户端时出现了此错误。
谢谢!
英文:
I wish to use the firebase admin-sdk but for some reason, I am getting a "project id is required to access Firestore error".
I have downloaded an admin-sdk json file from the firebase console and I have placed it in the same directory as the file that calls it.
opt := option.WithCredentialsFile("../<FILENAME>.json")
The credentials file has the project id but for some reason the opt
variable is unable to extract data from the credentials file, and as a result when I try to get the firestore client this error is occuring.
Thanks!
答案1
得分: 4
问题解决了,我使用了错误的绝对路径。
英文:
Problem solved, I was using the wrong absolute path.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论