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:
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
In my case, I made 2 applicatiions in 1 firebase project. google-services.json downloaded from firebase has 2 client informations. I get the same error with this setup.
{
"project_info": {
"project_number": "xxxxxx",
"firebase_url": "xxxxxx.firebaseio.com",
"project_id": "xxxxxx",
......
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "xxxxxx",
"android_client_info": {
"package_name": "application-1"
}
},
.......
"api_key": [
{
"current_key": "(API-Key for application1)"
},
{
"current_key": "(API-Key for application2)"
}
],
.......
},
{
"client_info": {
"mobilesdk_app_id": "xxxxxx",
"android_client_info": {
"package_name": "application-2"
}
},
......
"api_key": [
{
"current_key": "(API-Key for application1)"
},
{
"current_key": "(API-Key for application2)"
}
],
......
}
],
"configuration_version": "1"
}
I edited google-services.json and made it simple for application-2. This works well.
{
"project_info": {
"project_number": "xxxxxx",
"firebase_url": "xxxxxx.firebaseio.com",
"project_id": "xxxxxx",
......
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "xxxxxx",
"android_client_info": {
"package_name": "application-2"
}
},
......
"api_key": [
{
"current_key": "(API-Key for application2)"
}
],
......
}
],
"configuration_version": "1"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With