react-native-firebase icon indicating copy to clipboard operation
react-native-firebase copied to clipboard

[πŸ›] Crashlytics not recording anything in the dashboard in ios

Open renesoaresse opened this issue 1 year ago β€’ 9 comments
trafficstars

Crashlytics implementation now its not working properly When running on ios emulator its always said following debug logs. i have followed everything in this also but no luck - https://invertase.io/blog/react-native-firebase-crashlytics-configuration

debug logs as below

2024-03-01 15:57:25.266 Df [70950:496b75] [Firebase/Crashlytics] Version 10.15.0
2024-03-01 15:57:25.273 Db [70950:496b75] [com.apple.defaults:User Defaults] found no value for key crashlytics_debug_enabled in CFPrefsSearchListSource<0x60000300c990> (Domain: io.invertase.firebase, Container: (null))
2024-03-01 15:57:25.273 Df [70950:496b75] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 157] RNFBCrashlyticsInit crashlytics_debug_enabled via RNFBMeta: 0
2024-03-01 15:57:25.273 Df [70950:496b75] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 160] RNFBCrashlyticsInit crashlytics_debug_enabled final value: 0
2024-03-01 15:57:25.274 Df [70950:496b75] +[RNFBCrashlyticsInitProvider isCrashlyticsCollectionEnabled] [Line 49] RNFBCrashlyticsInit isCrashlyticsCollectionEnabled after checking crashlytics_debug_enabled: 0
2024-03-01 15:57:25.274 Df [70950:496b75] +[RNFBCrashlyticsInitProvider configureWithApp:] [Line 101] RNFBCrashlyticsInit initialization successful
2024-03-01 15:57:26.138 Db [70950:496bb9] [com.apple.defaults:User Defaults] found no value for key crashlytics_debug_enabled in CFPrefsSearchListSource<0x60000300c990> (Domain: io.invertase.firebase, Container: (null))
2024-03-01 15:57:26.138 Df [70950:496bb9] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 157] RNFBCrashlyticsInit crashlytics_debug_enabled via RNFBMeta: 0
2024-03-01 15:57:26.139 Df [70950:496bb9] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 160] RNFBCrashlyticsInit crashlytics_debug_enabled final value: 0
2024-03-01 15:57:26.139 Df [70950:496bb9] +[RNFBCrashlyticsInitProvider isCrashlyticsCollectionEnabled] [Line 49] RNFBCrashlyticsInit isCrashlyticsCollectionEnabled after checking crashlytics_debug_enabled: 0
2024-03-01 15:57:26.139 Db [70950:496bb9] [com.apple.defaults:User Defaults] found no value for key crashlytics_is_error_generation_on_js_crash_enabled in CFPrefsSearchListSource<0x60000300c990> (Domain: io.invertase.firebase, Container: (null))
2024-03-01 15:57:26.139 Df [70950:496bb9] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 157] RNFBCrashlyticsInit crashlytics_is_error_generation_on_js_crash_enabled via RNFBMeta: 1
2024-03-01 15:57:26.139 Df [70950:496bb9] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 160] RNFBCrashlyticsInit crashlytics_is_error_generation_on_js_crash_enabled final value: 1
2024-03-01 15:57:26.139 Db [70950:496bb9] [com.apple.defaults:User Defaults] found no value for key crashlytics_javascript_exception_handler_chaining_enabled in CFPrefsSearchListSource<0x60000300c990> (Domain: io.invertase.firebase, Container: (null))
2024-03-01 15:57:26.139 Df [70950:496bb9] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 157] RNFBCrashlyticsInit crashlytics_javascript_exception_handler_chaining_enabled via RNFBMeta: 1
2024-03-01 15:57:26.139 Df [70950:496bb9] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 160] RNFBCrashlyticsInit crashlytics_javascript_exception_handler_chaining_enabled final value: 1

Libs Version

"@react-native-firebase/analytics": "18.6.0",
"@react-native-firebase/app": "18.6.0",
"@react-native-firebase/auth": "18.6.0",
"@react-native-firebase/crashlytics": "18.6.0",
"@react-native-firebase/database": "18.6.0",
 "react": "18.2.0",
 "react-native": "0.71-stable",

firebase.json

{
  "react-native": {
    "crashlytics_debug_enabled": true,
    "crashlytics_disable_auto_disabler": true,
    "crashlytics_auto_collection_enabled": true,
    "crashlytics_is_error_generation_on_js_crash_enabled": true,
    "crashlytics_javascript_exception_handler_chaining_enabled": true
  }
}

renesoaresse avatar Mar 01 '24 19:03 renesoaresse

Hi there! After changing values in firebase.json, you need to run pod install

From the log output it appears that it sees "crashlytics_debug_enabled" as false, but firebase.json has it as true so my guess is that you have not run pod install after changing firebase.json

Give that a try (pod install), then rebuild the ios app and retry and it should work

mikehardy avatar Mar 01 '24 19:03 mikehardy

@mikehardy Thank you very much for your quick response. I did exactly that more than once. From what I understand, the lib uses something from ruby ​​to be able to add data to the project. But the same error remains.

renesoaresse avatar Mar 01 '24 19:03 renesoaresse

Yes, ios_config.sh is installed as an xcode build task by pod install and that script puts firebase.json inside the info plist for the app in the deriveddata folder as a a base64 blob in an attribute

That is then read by the react-native-firebase code to pull your config values

Something in that chain isn't happening but you can find the plist in deriveddata and check if firebase.json is in there with correct values after decoding it , and you could alter ios_config.sh to print what it sees

You can make sure the build you make is actually what runs. Something isn't correct but Im not sure what, I just know it's possible and works for me so the code in repo should be right

mikehardy avatar Mar 01 '24 20:03 mikehardy

I checked the derived data and found that in info.plist and scm.plist the data from firebase.json is not imported, like the prints below. Or am I going to the wrong .plist? Is there any way to do this import manually?

img1 img2

renesoaresse avatar Mar 04 '24 12:03 renesoaresse

Hi, I'm also facing the same issue on iOS. It's working fine on Android though

Abhishek2250 avatar Mar 12 '24 11:03 Abhishek2250

Same here.

BouarourMohammed avatar Mar 21 '24 14:03 BouarourMohammed

Same here!

diegoromero93 avatar Apr 02 '24 23:04 diegoromero93

Maybe it could help.

I faced the same problem, but in my case we disabled autolinking for Firebase (on purpose, project needs) and integrated it manually. Probably because of this we accidentally skipped few scripts for IOS which could help to solve everything if autolinking is enabled.

So to fix it we added few Run Scripts for specific targets in Xcode, like that:

  1. [RNFB] Core Configuration This goes into run script: "../node_modules/@react-native-firebase/app/ios_config.sh" This goes into Input File: "$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)"

  2. [RNFB] Core Configuration This goes into run script: "../node_modules/@react-native-firebase/crashlytics/ios_config.sh" This goes into Input File: "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}" "$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)"

Screenshot 2024-04-10 at 10 23 56 Screenshot 2024-04-10 at 10 24 16

RedMaxMay avatar Apr 10 '24 08:04 RedMaxMay

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 attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.

github-actions[bot] avatar May 08 '24 08:05 github-actions[bot]

@RedMaxMay that solved the issue we were having! Thanks for the help πŸ™Œ

kieranphilipbrown avatar Jun 19 '24 14:06 kieranphilipbrown

Maybe it could help.

I faced the same problem, but in my case we disabled autolinking for Firebase (on purpose, project needs) and integrated it manually. Probably because of this we accidentally skipped few scripts for IOS which could help to solve everything if autolinking is enabled.

So to fix it we added few Run Scripts for specific targets in Xcode, like that:

  1. [RNFB] Core Configuration This goes into run script: "../node_modules/@react-native-firebase/app/ios_config.sh" This goes into Input File: "$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)"
  2. [RNFB] Core Configuration This goes into run script: "../node_modules/@react-native-firebase/crashlytics/ios_config.sh" This goes into Input File: "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}" "$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)"

Screenshot 2024-04-10 at 10 23 56 Screenshot 2024-04-10 at 10 24 16

@RedMaxMay Thanks for your sharing! After removing auto-linking for both @react-native-firebase/app and @react-native-firebase/crashlytics by adding it in my react-native.config.js:

module.exports = {
  dependencies: {
    ...(process.env.NO_FLIPPER
      ? { 'react-native-flipper': { platforms: { ios: null } } }
      : {}),
    '@react-native-firebase/app': {
      platforms: {
        ios: null,
        android: null
      }
    },
    '@react-native-firebase/crashlytics': {
      platforms: {
        ios: null,
        android: null
      }
    }
  }
};

And also added both Run Scripts, I faced an issue trying to build my target. The log is not descriptive and straightforward, it only mentioned that the build failed. Do you have any idea on this? Thanks.

yapyeeqiang avatar Jun 25 '24 07:06 yapyeeqiang