【发布时间】:2020-08-10 16:46:12
【问题描述】:
我在应用启动状态日志中收到一条错误消息,例如
W/Firebase-Installations: Error when communicating with the Firebase Installations server API. HTTP response: [400 Bad Request: {
"error": {
"code": 400,
"message": "API key not valid. Please pass a valid API key.",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.Help",
"links": [
{
"description": "Google developers console",
"url": "https://console.developers.google.com"
}
]
}
]
}
}
]
2020-04-27 12:42:34.621 22226-23596/in.co.androidapp.g7 E/Firebase-Installations: Firebase Installations can not communicate with Firebase server APIs due to invalid configuration. Please update your Firebase initialization process and set valid Firebase options (API key, Project ID, Application ID) when initializing Firebase.
大约一周前我收到一封电子邮件,我应该更新我的 google_services.json 文件,我已经完成了 4-5 次。没有改进。它已经工作了大约一年。距离我在应用程序中遇到此问题仅 2-3 天。
随后,Firebase 云消息传递和其他 Firebase 服务无法正常工作。我不是在做程序初始化(即使用 FirebaseOptions 对象来提供这些值),只是使用FirebaseApp.initializeApp(this);的默认初始化
提前致谢。
【问题讨论】:
-
您的软件包名称在 firebase 控制台中是否正确?
-
@NullByte08 是的,它已经运行了大约一年
-
要进一步分析此问题,我们需要查看您的 API 密钥。您能否分享 API 密钥并将中间的 10 个字符替换为一些替换字符(例如“X”)而不更改密钥的长度?
-
@AndreasRayoKniep AIzaSyCrf5T0QyCUABJhZTsks7ep%%%%%%%%%%Y
-
@DakshAgrawal:这看起来像是一个有效的 API 密钥,我很困惑如何获得“API 密钥无效”。作为服务器响应。我感觉对服务器的实际请求不使用此 API 密钥 - 要么使用不同的(无效)API 密钥,要么以某种方式无权访问此 API 密钥。