React-native-firebase: [v6] Crashlytics not working unless it's enabled in firebase.json

Created on 14 Oct 2019  路  26Comments  路  Source: invertase/react-native-firebase

Documentation Feedback

I couldn't get the library to work until I added firebase.json with "crashlytics_auto_collection_enabled": true.

Please add it to documentation because it's not mentioned anywhere.

Crashlytics Docs Stale >= 6

Most helpful comment

@Ehesp I didn't find much information about firebase.json
Can you point in the documentation where I need to put the firebase.json? I checked the quick start and only found information about the correct setup for native (Android/iOS).
I'm used to native, so I haven't setup crashlytics in react native before. I found some places mentioning firebase.json, but not an example at least on the quickstarts on the documentation

All 26 comments

This shouldn't be the case, it should work without that value. We'll test and push any fixes.

hmm okay. In that case this is the debug log that was generated when it didn't work.
Notice that the only output is from Fabric. There wasn't any CrashlyticsCore until I added firebase.json.
I also tried manually enabling it in the app, but nothing changes.

Debug log

10-14 13:11:20.367 13250 13297 D Fabric  : Falling back to Crashlytics key lookup from Manifest
10-14 13:11:20.368 13250 13297 D Fabric  : Falling back to Crashlytics key lookup from Strings
10-14 13:11:20.369 13250 13297 D Fabric  : Generating Crashlytics ApiKey from google_app_id in Strings
10-14 13:11:20.383 13250 13307 D Fabric  : Using AdvertisingInfo from Preference Store
10-14 13:11:20.385 13250 13250 D Fabric  : Falling back to Crashlytics key lookup from Manifest
10-14 13:11:20.386 13250 13250 D Fabric  : Falling back to Crashlytics key lookup from Strings
10-14 13:11:20.396 13250 13297 D Fabric  : Build ID is: buildID
10-14 13:11:20.397 13250 13307 D Fabric  : Falling back to Crashlytics key lookup from Manifest
10-14 13:11:20.398 13250 13307 D Fabric  : Falling back to Crashlytics key lookup from Strings
10-14 13:11:20.399 13250 13307 D Fabric  : Build ID is: buildID
10-14 13:11:20.409 13250 13250 D Fabric  : Initializing io.fabric.sdk.android:fabric [Version: 1.4.8.32], with the following kits:
10-14 13:11:20.409 13250 13250 D Fabric  : com.crashlytics.sdk.android:answers [Version: 1.4.7.32]
10-14 13:11:20.409 13250 13250 D Fabric  : com.crashlytics.sdk.android:crashlytics [Version: 2.10.1.34]
10-14 13:11:20.409 13250 13250 D Fabric  : com.crashlytics.sdk.android:beta [Version: 1.2.10.27]
10-14 13:11:20.409 13250 13250 D Fabric  : com.crashlytics.sdk.android.crashlytics-ndk [Version: 2.1.0.33]
10-14 13:11:20.409 13250 13250 D Fabric  : com.crashlytics.sdk.android.crashlytics-core [Version: 2.7.0.33]
10-14 13:11:20.409 13250 13250 D Fabric  : 
10-14 13:11:20.411 13250 13297 D Fabric  : Build ID is: buildID
10-14 13:11:20.417 13250 13250 D Fabric  : Falling back to Crashlytics key lookup from Manifest
10-14 13:11:20.418 13250 13250 D Fabric  : Falling back to Crashlytics key lookup from Strings
10-14 13:11:20.437 13250 13297 D Fabric  : Requesting settings from https://settings.crashlytics.com/spi/v2/platforms/android/apps/com.myapp/settings
10-14 13:11:20.438 13250 13297 D Fabric  : Settings query params were: <params>
10-14 13:11:21.156 13250 13297 D Fabric  : Settings result was: 200
10-14 13:11:21.168 13250 13297 D Fabric  : Settings request ID: requestID
10-14 13:11:21.176 13250 13297 D Fabric  : Writing settings to cache file...
10-14 13:11:21.192 13250 13297 D Fabric  : Loaded settings: {"settings_version":2,"cache_duration":7200,"features":{"collect_logged_exceptions":true,"collect_reports":true,"collect_analytics":false,"prompt_enabled":false,"push_enabled":true,"firebase_crashlytics_enabled":true},"analytics":{"url":"https:\/\/e.crashlytics.com\/spi\/v2\/events","flush_interval_secs":120,"max_file_count_per_send":1,"track_custom_events":true,"track_predefined_events":true,"track_view_controllers":false,"flush_on_background":true,"max_byte_size_per_file":40000,"max_pending_send_file_count":20,"sampling_rate":1,"forward_to_google_analytics":false,"include_purchase_events_in_forwarded_events":false},"beta":{"update_suspend_duration":1209600,"update_endpoint":""},"app":{"identifier":"com.myapp","status":"activated","url":"https:\/\/api.crashlytics.com\/spi\/v1\/platforms\/android\/apps\/com.myapp","reports_url":"https:\/\/reports.crashlytics.com\/spi\/v1\/platforms\/android\/apps\/com.myapp\/reports","ndk_reports_url":"https:\/\/reports.crashlytics.com\/sdk-api\/v1\/platforms\/android\/apps\/com.myapp\/minidumps","update_required":true},"session":{"log_buffer_size":64000,"max_chained_exception_depth":16,"max_complete_sessions_count":4,"max_custom_exception_events":8,"max_custom_key_value_pairs":64,"identifier_mask":255},"prompt":{"title":"Send Crash Report?","message":"Looks like we crashed! Please help us fix the problem by sending a crash report.","send_button_title":"Send","show_cancel_button":true,"cancel_button_title":"Don't Send","show_always_send_button":true,"always_send_button_title":"Always Send"},"expires_at":1571058681175}
10-14 13:11:21.192 13250 13297 D Fabric  : Build ID is: buildID
10-14 13:11:21.194 13250 13297 D Fabric  : Server says an update is required - forcing a full App update.
10-14 13:11:21.195 13250 13297 D Fabric  : App icon resource ID is iconResouceID
10-14 13:11:21.198 13250 13297 D Fabric  : Falling back to Crashlytics key lookup from Manifest
10-14 13:11:21.198 13250 13297 D Fabric  : Falling back to Crashlytics key lookup from Strings
10-14 13:11:21.198 13250 13297 D Fabric  : Generating Crashlytics ApiKey from google_app_id in Strings
10-14 13:11:21.200 13250 13297 D Fabric  : Build ID is: buildID
10-14 13:11:21.359 13250 13309 D Fabric  : Using AdvertisingInfo from Reflection Provider
10-14 13:11:21.744 13250 13297 D Fabric  : Sending app info to https://api.crashlytics.com/spi/v1/platforms/android/apps/com.myapp
10-14 13:11:21.745 13250 13297 D Fabric  : App icon hash is <hash>
10-14 13:11:21.749 13250 13297 D Fabric  : App icon size is -1x-1
10-14 13:11:22.255 13250 13297 D Fabric  : Update app request ID: <id>
10-14 13:11:22.256 13250 13297 D Fabric  : Result was 204

Same here.
But I managed to get it working with Release

I tried this out this morning. I installed the crashlytics dependency, pod installed, crashed the app, reopened it and my crash was there. I didn't touch the firebase.json file.

I tried it out again in a clean project.
In release it works without firebase.json as you stated earlier.
In debug, it's not gonna work without crashlytics_debug_enabled: true in firebase.json. This sounds reasonable.

(Tested Android only)

I guess it's working fine. Just maybe it would be good to add a note in docs that crashlytics_debug_enabled flag is required for testing in debug mode.

@Ehesp I didn't find much information about firebase.json
Can you point in the documentation where I need to put the firebase.json? I checked the quick start and only found information about the correct setup for native (Android/iOS).
I'm used to native, so I haven't setup crashlytics in react native before. I found some places mentioning firebase.json, but not an example at least on the quickstarts on the documentation

I tried to follow the steps and it seems to be all set up. But it still not working in debug or release mode.

The page that should be about the firebase-json it's not working.
https://invertase.io/oss/react-native-firebase/v6/app/firebase-json

Page Not Found
Looks like you've followed a broken link or entered a URL that doesn't exist on this site.
"@react-native-firebase/app": "^6.0.3",
"@react-native-firebase/crashlytics": "^6.0.3",
"react": "16.9.0",
"react-native": "0.60.5",
Page Not Found
Looks like you've followed a broken link or entered a URL that doesn't exist on this site.

I used this one https://invertase.io/oss/react-native-firebase/v6/app/reference/firebasejsonconfig

Thanks, but even adding crashlytics_debug_enabled: true I still not getting my logs at firebase dashboard (release or debug).

I was not able to send logs on android, while ios worked fine since the first moment.
Then I added firebase.json (at root level in the project), but the crucial settings wasn't crashlytics_auto_collection_enabled, instead was:

{ "react-native": { "crashlytics_debug_enabled": true } }

If I remove "crashlytics_debug_enabled" android stops to send logs (even if crashlytics_auto_collection_enabled is present), I tried three times.

I have two flavors in my android project, maybe this could be the key.

I believe those are separate features. That one is enabled by default, and you only want to use it if you want to disable automatic crash collection, for instance if you wanted it to be default-off / opt-in for users in order to respect privacy more: https://firebase.google.com/docs/crashlytics/customize-crash-reports?platform=android#enable_opt-in_reporting

the debug one seems more relevant

Crashlytics is enabled by default - there's no need to change any firebase.json settings to enable it - have confirmed this in a new project today. crashlytics_auto_collection_enabled is true by default.

If this is Android make sure you've followed the additional steps mentioned here:
https://invertase.io/oss/react-native-firebase/v6/crashlytics/android-setup - especially this bit if you've migrated from Fabric:

image


We'll get some docs added to each of the firebase.json options though that explain what each option is for.

We'll get some docs added to each of the firebase.json options though that explain what each option is for.

@Salakar Please also add a small note to this page https://invertase.io/oss/react-native-firebase/v6/crashlytics/android-setup that for testing in debug, crashlytics_debug_enabled needs to be set to true.

This is crucial to save hours trying to figure out why it's not working in debug mode 馃槄

@mskec there's an edit button on the top of each page :-)

I added the following in firebase.json in root of my React Native Project directory but still I am not able to see logs in debug & release mode

{ "react-native": { "analytics_auto_collection_enabled": true, "crashlytics_debug_enabled": true } }

Package.json

"@react-native-firebase/analytics": "^6.0.3", "@react-native-firebase/app": "^6.0.3", "@react-native-firebase/crashlytics": "^6.0.3",

Also i did initialize it using
await firebase.crashlytics().setCrashlyticsCollectionEnabled(true);

We'll get some docs added to each of the firebase.json options though that explain what each option is for.

@Salakar Please also add a small note to this page https://invertase.io/oss/react-native-firebase/v6/crashlytics/android-setup that for testing in debug, crashlytics_debug_enabled needs to be set to true.

This is crucial to save hours trying to figure out why it's not working in debug mode 馃槄

For me with this flag crashlytics_debug_enabled : true finally works!!

Still getting no logs in firebase dashboard, even with "crashlytics_debug_enabled": true,. I tried to follow step by step and I can't figure it out what's missing.

Now what I'm getting it's

12-11 11:05:55.031  9422  9463 D CrashlyticsCore: Opening a new session with ID ***...
12-11 11:05:55.037  9422  9457 D Fabric  : Build ID is: ***...
12-11 11:05:55.047  9422  9457 D Fabric  : Requesting settings from https://settings.crashlytics.com/spi/v2/platforms/android/apps/com.myapp/settings
12-11 11:05:55.047  9422  9457 D Fabric  : Settings query params were: {icon_hash=***..., display_version=***..., source=1, instance=***..., build_version=***...}
12-11 11:05:56.098  9422  9457 D Fabric  : Settings result was: 403
12-11 11:05:56.098  9422  9457 E Fabric  : Failed to retrieve settings from https://settings.crashlytics.com/spi/v2/platforms/android/apps/com.myapp/settings
12-11 11:05:56.098  9422  9457 D Fabric  : Settings request ID: null
12-11 11:05:56.099  9422  9457 D Fabric  : Reading cached settings...
12-11 11:05:56.104  9422  9457 D Fabric  : No cached settings found.
12-11 11:05:56.104  9422  9457 D Fabric  : No cached settings data found.
12-11 11:05:56.109  9422  9463 D CrashlyticsCore: Initialization marker file created.
12-11 11:05:56.116  9422  9455 W CrashlyticsCore: Received null settings, skipping report submission!
12-11 11:05:56.116  9422  9463 D CrashlyticsCore: Initialization marker file removed: true

Does this means something?

"@react-native-firebase/admob": "^6.2.0",
"@react-native-firebase/crashlytics": "^6.2.0",
"react": "16.12.0",
"react-native": "0.61.5",

Hello 馃憢, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?

This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.

I think this is still "active" issue.

Having similar problem here, although adding firebase.json to the root of our project solved it for Android, on iOS we are still not receiving events.

What we did:

  • removed all past Fabric references
  • installed @react-native-firebase/app and @react-native-firebase/crashlytics
  • added the GoogelServices-info.plist through xCode as explained
  • added the code to appDelegate.m

Didn't work. We also tried to:

  • add firebase.json to iOS folder
  • remove all node modules, pods, build, cache and installed all again

Might be that old Fabric users (like us) are missing something, but can't find anything. We are going back to react-native-fabric for now as we can'tt find a solution

Hello 馃憢, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?

This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.

it still require the community's attention

On the Firebase Console Crashlytics tab, what shows when you select your app? Googling, it seems to suggest the Received null settings, skipping report submission! message is sent when Crashlytics isn't setup on Firebase correctly.

Some of the issues reported here may be specific to legacy Fabric users. I removed my Fabric API keys to get around an issue with having to add the key to the iOS build scripts (and advice provided there). However, on the next release Crashlytics stopped logging entirely. They've now added a warning banner on the site:

image

With a link to more details here.

The API key needs to be there for Fabric users until such time as we switch to the new (beta) Firebase Crashlytics SDK it would seem.

Hello 馃憢, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?

This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.

Closing this issue after a prolonged period of inactivity. If this is still present in the latest release, please feel free to create a new issue with up-to-date information.

Was this page helpful?
0 / 5 - 0 ratings