16

I have implemented FCM and Firebase analytics with success in my project but I found an error trying with Firebase crash reporting and I don't have any idea what I'm missing.

I'm just trying to use Firebase crash reporting following the official tutorial and getting this error:
enter image description here It said:

Server did not receive report: Origin Error message: Requests from this Android client application com.xxxxxx are blocked.

After dig in google and here (stack overflow), I found some related questions ( link 1, link 2, link 3) but none of their solutions work for me. I mean, someone talk about check API_KEY, someone else talk about check crash report enabled in console and the list keep going. I have tried those answers before posting this question.

update: Explaining a little bit for those didn't want to look above links: I tried updating the google-services.json file changing the API_KEY, deleting and adding again SHA1, leaving API_KEY empty, etc. Downloading the google-services.json file for each change I did with no luck.

My API_KEY in my google-services.json file looks like:

"api_key": [
    {
      "current_key": "AIzaxxxxxxxxxxzxxxxxx"
    },
    {
      "current_key": "AIzaxxxxxxxxxxxxxx"
    }
  ],

And I checked that my google-service.json has debug and release SHA1.

update The weird thing is that I'm getting reports in Analytics section, as you can see in next screenshot:

enter image description here



Looking the project in console.developers.google.com I found that I have Mobile Crash and Performance Reporting API enabled (like you can see in the follow screenshot):

enter image description here

After clicking in "Mobile Crash and Performance Reporting API" I got this: enter image description here The image above shows 2 images: all traffic to "Mobile Crash and Performance Reporting API" done and the errors processed by the API. As you can see it said that all my request were 403 Error (you can see it where it said 403:0.0004): and that's true, I've tried 4 times and all time I got same console error.

No idea what is going on or what I'm missing

If you need info about gradle app file to help me, here is:

compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'com.google.firebase:firebase-crash:10.0.1'
compile 'com.google.android.gms:play-services-maps:10.0.1'
compile 'com.google.android.gms:play-services-location:10.0.1'
compile 'com.google.android.gms:play-services-awareness:10.0.1'

Community
  • 1
  • 1
MiguelHincapieC
  • 5,445
  • 7
  • 41
  • 72

3 Answers3

8

I had the same issue, solved it by setting the API key Key restriction in Google Console to NONE.

rubberdont
  • 464
  • 3
  • 15
  • I like you was my problem. Thanks for your solution. – ultra.deep Mar 10 '17 at 08:38
  • Thanks man! So helpful. Would have never found that mistake myself. Was trying to add Firebase In-App messaging to my app, but this service didn't pass the package name to the API, so the restriction which I have set in the past blocked the request. – Panther Sep 06 '18 at 19:47
  • 2
    This answer works but if you're supposed to set the bundleId to the **Key restriction > Application restrictions** what is the purpose of it if only **NONE** works? – Lance Samaria Sep 16 '19 at 07:04
2

I had the same issue, resolved it by download a new configuration file google-services.json.

Ahmed Abidi
  • 1,047
  • 12
  • 24
1

I had similar problems and I tried dropping the gradle levels, which helped me because of some stability issues in the newest ones.

to:

compile 'com.google.firebase:firebase-core:9.2.1'
compile 'com.google.firebase:firebase-messaging:9.2.1'
compile 'com.google.firebase:firebase-crash:9.2.1'
compile 'com.google.android.gms:play-services-maps:9.2.1'
compile 'com.google.android.gms:play-services-location:9.2.1'
compile 'com.google.android.gms:play-services-awareness:9.2.1'

also you sdk to :

compileSdkVersion 23
buildToolsVersion "21.1.2"

defaultConfig {
    applicationId "cloud.savari.example.com.fcm"
    minSdkVersion 17
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
  • 1
    but I can't drop down levels because I'm using [setCurrentScreen](https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics#setCurrentScreen(android.app.Activity,%20java.lang.String,%20java.lang.String)) witch is available since 9.8 – MiguelHincapieC Feb 03 '17 at 22:32
  • Then I would suggest you drop it down as much as you can and then retry. I went down to `9.2.1` and not lesser than that because of `locations and FCM` try playing around with the versions but make sure that `play-services and firebase` are on the same version. – anish kumaramangalam Feb 03 '17 at 22:38