A have a big project with a lot of dependencies including Firebase.
Now com.google.firebase:firebase-messaging has version 17.3.3. I want to update it to the 20.2.1.
I'm getting next error after app has started:
Firebase-Installations: Error when communicating with the Firebase Installations server API. HTTP response: [403 Forbidden: {
"error": {
"code": 403,
"message": "Requests from this Android client application com.example are blocked.",
"status": "PERMISSION_DENIED",
"details": [
{
"@type": "type.googleapis.com/google.rpc.Help",
"links": [
{
"description": "Google developer console API key",
"url": "https://console.developers.google.com/project/61947752567/apiui/credential"
}
]
}
]
}
}
]
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.
We use google-services.json to configure FCM in our app. We do not use FirebaseOptions in code.
I've noticed that the problem is connected with updating FCM to 20.1.1. And what Google says about FCM 20.1.1:
The Firebase Cloud Messaging and Firebase Instance ID SDKs now transitively depend on the Firebase installations SDK. If you use Cloud Messaging and update your dependencies to their latest versions, make sure that push notifications still work as expected.
I read an instruction from Google but no success. What I tried:
- Re-download google-services.json from Firebase console. No success because it's identical.
- Apply instruction about API-Key restrictions inside Firebase Console. It turned out that we don't have any restrictions ("Don't restrict key" option is checked).
- Update all of Firebase (including firebase-perf) and GCM dependencies to the latest versions. No changes.
- Set App ID, project ID and API-Key with FirebaseOptions right in the code before calling initializeApp method.
It also turned out that installed from APK application works correctly! If I use .aab (App Bundle) - I'm getting this error. I also use the latest bundletool.
firebase-messaging is included into our main app-module and it's one of the main features of application. I'm not talking about dynamic modules - the problem is with the main module.
I can't setup FCM again because there are a lot of users who use this application now. Also I can't understand why I have to set valid options (API key, Project ID, Application ID) if this options work great for last few years and google-services.json has not changes.
I will be grateful for any ideas.
P.S. I can't use FCM 20.1.0 because I need to integrate ML Kit dependency. It works only with actual version of FCM and crashes with FCM 20.1.0