Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛]🔥 Crashlytics not enabled on iOS #8427

Open
2 of 10 tasks
enriquezc opened this issue Mar 26, 2025 · 3 comments
Open
2 of 10 tasks

[🐛]🔥 Crashlytics not enabled on iOS #8427

enriquezc opened this issue Mar 26, 2025 · 3 comments

Comments

@enriquezc
Copy link

Issue

When adding crashlytics to our production app, we are able to see crashes on our console for the android version, but when we try to get a crash in our iOS app to confirm that crashlytics is collecting crashes, we are repeatedly getting the message that "Crash reporting could not be initialized." I've attached the logs from running xcrun simctl spawn booted log stream --level debug --style compact | grep -i crash where these messages show up on app start up when the reporting should normally be taking place.


Project Files

Javascript

Click To Expand

package.json:

 "dependencies": {
    "@microsoft/signalr": "^8.0.0",
    "@react-native-async-storage/async-storage": "^1.23.1",
    "@react-native-clipboard/clipboard": "^1.14.0",
    "@react-native-community/push-notification-ios": "^1.11.0",
    "@react-native-firebase/analytics": "^21.12.2",
    "@react-native-firebase/app": "^21.12.2",
    "@react-native-firebase/crashlytics": "^21.12.2",
    "@react-native-firebase/perf": "^21.12.2",
    "@react-navigation/bottom-tabs": "^6.5.20",
    "@react-navigation/native": "^6.1.17",
    "@react-navigation/stack": "^6.3.29",
    "@reduxjs/toolkit": "^2.2.3",
    "@rneui/base": "^4.0.0-rc.8",
    "@rneui/themed": "^4.0.0-rc.8",
    "axios": "^1.6.8",
    "babel-plugin-module-resolver": "^5.0.2",
    "base-64": "^1.0.0",
    "big-integer": "^1.6.52",
    "bigint-polyfill": "^0.1.0",
    "crypto-js": "^4.2.0",
    "date-fns": "^3.6.0",
    "expo": "^50.0.0",
    "expo-secure-store": "~12.8.1",
    "jsbn": "^1.1.0",
    "jwt-decode": "^4.0.0",
    "lottie-react-native": "^6.7.2",
    "metro-babel-register": "^0.80.9",
    "password-validator": "^5.3.0",
    "postcode-validator": "^3.8.20",
    "prop-types": "^15.8.1",
    "react": "18.2.0",
    "react-native": "0.73.6",
    "react-native-base64": "^0.2.1",
    "react-native-ble-plx": "^2.0.3",
    "react-native-bluetooth-state-manager": "^1.3.5",
    "react-native-collapsible": "^1.6.1",
    "react-native-config": "^1.4.6",
    "react-native-device-info": "^10.13.1",
    "react-native-error-boundary": "^1.2.4",
    "react-native-gesture-handler": "^2.16.0",
    "react-native-keyboard-aware-scroll-view": "^0.9.5",
    "react-native-linear-gradient": "^2.8.3",
    "react-native-modal": "^13.0.1",
    "react-native-permissions": "^4.1.5",
    "react-native-platform-touchable": "^1.1.1",
    "react-native-push-notification": "^8.1.1",
    "react-native-reanimated": "^3.16.1",
    "react-native-safe-area-context": "^4.9.0",
    "react-native-screens": "^3.30.1",
    "react-native-splash-screen": "^3.3.0",
    "react-native-svg": "^15.1.0",
    "react-native-toast-message": "^2.2.0",
    "react-native-typography": "^1.4.1",
    "react-native-url-polyfill": "^2.0.0",
    "react-native-vector-icons": "^10.1.0",
    "react-native-webview": "^13.8.4",
    "react-native-wifi-reborn": "^4.12.1",
    "react-redux": "^9.1.1",
    "reactotron-react-native": "^5.1.6",
    "reactotron-redux": "^3.1.9",
    "redux": "^5.0.1",
    "redux-thunk": "^3.1.0",
    "rn-android-keyboard-adjust": "^2.1.2",
    "sunrise-sunset-js": "^2.2.1",
    "superstruct": "^2.0.2",
    "ts-jest": "^29.1.2"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@babel/preset-env": "^7.24.5",
    "@babel/runtime": "^7.20.0",
    "@react-native/babel-preset": "0.73.21",
    "@react-native/eslint-config": "0.73.2",
    "@react-native/metro-config": "0.73.5",
    "@react-native/typescript-config": "0.73.1",
    "@types/react": "^18.2.6",
    "@types/react-test-renderer": "^18.0.0",
    "babel-jest": "^29.7.0",
    "eslint": "^8.19.0",
    "jest": "^29.7.0",
    "prettier": "2.8.8",
    "react-test-renderer": "18.2.0",
    "typescript": "5.0.4"
  },
  "engines": {
    "node": ">=18"
  }

firebase.json for react-native-firebase v6:

{
  "react-native": {
    "crashlytics_ndk_enabled": true,
    "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": false
  }
}

iOS

Click To Expand

ios/Podfile:

  • I'm not using Pods
  • I'm using Pods and my Podfile looks like:
require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
# Resolve react_native_pods.rb with node to allow for hoisting
#require Pod::Executable.execute_command('node', ['-p',
#  'require.resolve(
#    "react-native/scripts/react_native_pods.rb",
#    {paths: [process.argv[1]]},
#  )', __dir__]).strip

def node_require(script)
  # Resolve script with node to allow for hoisting
  require Pod::Executable.execute_command('node', ['-p',
    "require.resolve(
      '#{script}',
      {paths: [process.argv[1]]},
    )", __dir__]).strip
end

node_require('react-native/scripts/react_native_pods.rb')
node_require('react-native-permissions/scripts/setup.rb')

platform :ios, min_ios_version_supported
prepare_react_native_project!

setup_permissions([
  'Bluetooth',
  'Notifications',
])

# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
# because `react-native-flipper` depends on (FlipperKit,...) that will be excluded
#
# To fix this you can also exclude `react-native-flipper` using a `react-native.config.js`
# ```js
# module.exports = {
#   dependencies: {
#     ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
# ```
flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled

linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
  Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
  use_frameworks! :linkage => linkage.to_sym
end

target 'app' do
  use_expo_modules!
  post_integrate do |installer|
    begin
      expo_patch_react_imports!(installer)
    rescue => e
      Pod::UI.warn e
    end
  end
  config = use_native_modules!
  
  use_frameworks! :linkage => :static
  $RNFirebaseAsStaticFramework = true

  use_react_native!(
    :path => config[:reactNativePath],
    # Enables Flipper.
    #
    # Note that if you have use_frameworks! enabled, Flipper will not work and
    # you should disable the next line.
    # :flipper_configuration => flipper_config,
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  target 'Tests' do
    inherit! :complete
    # Pods for testing
  end

  post_install do |installer|
    # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
    react_native_post_install(
      installer,
      config[:reactNativePath],
      :mac_catalyst_enabled => false
    )
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
            config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
            config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
        end
    end
  end
end

AppDelegate.m:

#import "AppDelegate.h"

#import <React/RCTBundleURLProvider.h>
#import <Firebase.h>
#import <UserNotifications/UserNotifications.h>
#import <RNCPushNotificationIOS.h>

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  [FIRApp configure];
  [[FIRCrashlytics crashlytics] setCrashlyticsCollectionEnabled:YES];
  UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
  center.delegate = self;
  self.moduleName = @"app";
  // You can add your custom initial props in the dictionary below.
  // They will be passed down to the ViewController used by React Native.
  self.initialProps = @{};

  return [super application:application didFinishLaunchingWithOptions:launchOptions];
}

xcrun logs

2025-03-26 00:28:00.863 Df marvin-home[74052:1563c1c1] [Firebase/Crashlytics] Version 11.10.0
2025-03-26 00:28:00.866 E  marvin-home[74052:1563c1d1] [com.google.firebase:[FirebaseCrashlytics]] 11.10.0 - [FirebaseCrashlytics][I-CLS000000] Found legacy data collection key in app's Info.plist: firebase_crashlytics_collection_enabled
2025-03-26 00:28:00.866 E  marvin-home[74052:1563c1d1] [com.google.firebase:[FirebaseCrashlytics]] 11.10.0 - [FirebaseCrashlytics][I-CLS000000] Please update your Info.plist to use the new data collection key: FirebaseCrashlyticsCollectionEnabled
2025-03-26 00:28:00.866 E  marvin-home[74052:1563c1d1] [com.google.firebase:[FirebaseCrashlytics]] 11.10.0 - [FirebaseCrashlytics][I-CLS000000] The legacy data collection Info.plist value could be overridden by calling: [Fabric with:...]
2025-03-26 00:28:00.866 E  marvin-home[74052:1563c1d1] [com.google.firebase:[FirebaseCrashlytics]] 11.10.0 - [FirebaseCrashlytics][I-CLS000000] The new value can be overridden by calling: [[FIRCrashlytics crashlytics] setCrashlyticsCollectionEnabled:<isEnabled>]
2025-03-26 00:28:00.869 Db marvin-home[74052:1563c1c1] [com.apple.defaults:User Defaults] found no value for key crashlytics_debug_enabled in CFPrefsSearchListSource<0x600003001ef0> (Domain: io.invertase.firebase, Container: (null))
2025-03-26 00:28:00.869 Df marvin-home[74052:1563c1c1] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 155] RNFBCrashlyticsInit crashlytics_debug_enabled via RNFBJSON: 1
2025-03-26 00:28:00.869 Df marvin-home[74052:1563c1c1] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 165] RNFBCrashlyticsInit crashlytics_debug_enabled final value: 1
2025-03-26 00:28:00.869 Db marvin-home[74052:1563c1c1] [com.apple.defaults:User Defaults] looked up value 1 for key crashlytics_auto_collection_enabled in CFPrefsPlistSource<0x6000030027f0> (Domain: io.invertase.firebase, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x600003001ef0> (Domain: io.invertase.firebase, Container: (null))
2025-03-26 00:28:00.870 Db marvin-home[74052:1563c1c1] [com.apple.defaults:User Defaults] looked up value 1 for key crashlytics_auto_collection_enabled in CFPrefsPlistSource<0x6000030027f0> (Domain: io.invertase.firebase, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x600003001ef0> (Domain: io.invertase.firebase, Container: (null))
2025-03-26 00:28:00.870 Db marvin-home[74052:1563c1c1] [com.apple.defaults:User Defaults] looked up value 1 for key crashlytics_auto_collection_enabled in CFPrefsPlistSource<0x6000030027f0> (Domain: io.invertase.firebase, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x600003001ef0> (Domain: io.invertase.firebase, Container: (null))
2025-03-26 00:28:00.870 Db marvin-home[74052:1563c1c1] [com.apple.defaults:User Defaults] looked up value 1 for key crashlytics_auto_collection_enabled in CFPrefsPlistSource<0x6000030027f0> (Domain: io.invertase.firebase, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x600003001ef0> (Domain: io.invertase.firebase, Container: (null))
2025-03-26 00:28:00.870 Df marvin-home[74052:1563c1c1] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 150] RNFBCrashlyticsInit crashlytics_auto_collection_enabled via RNFBPreferences: 1
2025-03-26 00:28:00.870 Df marvin-home[74052:1563c1c1] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 165] RNFBCrashlyticsInit crashlytics_auto_collection_enabled final value: 1
2025-03-26 00:28:00.870 Df marvin-home[74052:1563c1c1] +[RNFBCrashlyticsInitProvider componentsToRegister]_block_invoke [Line 129] RNFBCrashlyticsInit initialization successful
2025-03-26 00:28:00.939 E  marvin-home[74052:1563c1d1] [com.google.firebase:[FirebaseCrashlytics]] 11.10.0 - [FirebaseCrashlytics][I-CLS000000] Crash reporting could not be initialized
        "firebase_crashlytics_enabled" = 0;
        "firebase_crashlytics_enabled" = 0;
        "firebase_crashlytics_enabled" = 0;
        "firebase_crashlytics_enabled" = 0;
        "firebase_crashlytics_enabled" = 0;
2025-03-26 00:28:01.310 Db marvin-home[74052:1563c1d8] [com.apple.defaults:User Defaults] found no value for key crashlytics_debug_enabled in CFPrefsSearchListSource<0x600003001ef0> (Domain: io.invertase.firebase, Container: (null))
2025-03-26 00:28:01.310 Df marvin-home[74052:1563c1d8] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 155] RNFBCrashlyticsInit crashlytics_debug_enabled via RNFBJSON: 1
2025-03-26 00:28:01.310 Df marvin-home[74052:1563c1d8] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 165] RNFBCrashlyticsInit crashlytics_debug_enabled final value: 1
2025-03-26 00:28:01.310 Db marvin-home[74052:1563c1d8] [com.apple.defaults:User Defaults] looked up value 1 for key crashlytics_auto_collection_enabled in CFPrefsPlistSource<0x6000030027f0> (Domain: io.invertase.firebase, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x600003001ef0> (Domain: io.invertase.firebase, Container: (null))
2025-03-26 00:28:01.310 Db marvin-home[74052:1563c1d8] [com.apple.defaults:User Defaults] looked up value 1 for key crashlytics_auto_collection_enabled in CFPrefsPlistSource<0x6000030027f0> (Domain: io.invertase.firebase, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x600003001ef0> (Domain: io.invertase.firebase, Container: (null))
2025-03-26 00:28:01.310 Db marvin-home[74052:1563c1d8] [com.apple.defaults:User Defaults] looked up value 1 for key crashlytics_auto_collection_enabled in CFPrefsPlistSource<0x6000030027f0> (Domain: io.invertase.firebase, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x600003001ef0> (Domain: io.invertase.firebase, Container: (null))
2025-03-26 00:28:01.310 Db marvin-home[74052:1563c1d8] [com.apple.defaults:User Defaults] looked up value 1 for key crashlytics_auto_collection_enabled in CFPrefsPlistSource<0x6000030027f0> (Domain: io.invertase.firebase, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x600003001ef0> (Domain: io.invertase.firebase, Container: (null))
2025-03-26 00:28:01.310 Df marvin-home[74052:1563c1d8] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 150] RNFBCrashlyticsInit crashlytics_auto_collection_enabled via RNFBPreferences: 1
2025-03-26 00:28:01.310 Df marvin-home[74052:1563c1d8] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 165] RNFBCrashlyticsInit crashlytics_auto_collection_enabled final value: 1
2025-03-26 00:28:01.310 Db marvin-home[74052:1563c1d8] [com.apple.defaults:User Defaults] found no value for key crashlytics_is_error_generation_on_js_crash_enabled in CFPrefsSearchListSource<0x600003001ef0> (Domain: io.invertase.firebase, Container: (null))
2025-03-26 00:28:01.310 Df marvin-home[74052:1563c1d8] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 155] RNFBCrashlyticsInit crashlytics_is_error_generation_on_js_crash_enabled via RNFBJSON: 1
2025-03-26 00:28:01.310 Df marvin-home[74052:1563c1d8] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 165] RNFBCrashlyticsInit crashlytics_is_error_generation_on_js_crash_enabled final value: 1
2025-03-26 00:28:01.310 Db marvin-home[74052:1563c1d8] [com.apple.defaults:User Defaults] found no value for key crashlytics_javascript_exception_handler_chaining_enabled in CFPrefsSearchListSource<0x600003001ef0> (Domain: io.invertase.firebase, Container: (null))
2025-03-26 00:28:01.310 Df marvin-home[74052:1563c1d8] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 155] RNFBCrashlyticsInit crashlytics_javascript_exception_handler_chaining_enabled via RNFBJSON: 0
2025-03-26 00:28:01.310 Df marvin-home[74052:1563c1d8] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 165] RNFBCrashlyticsInit crashlytics_javascript_exception_handler_chaining_enabled final value: 0


Android

Click To Expand

Have you converted to AndroidX?

  • my application is an AndroidX application?
  • I am using android/gradle.settings jetifier=true for Android compatibility?
  • I am using the NPM package jetifier for react-native compatibility?

android/build.gradle:

// N/A

android/app/build.gradle:

// N/A

android/settings.gradle:

// N/A

MainApplication.java:

// N/A

AndroidManifest.xml:

<!-- N/A -->


Environment

Click To Expand

react-native info output:

 System:
  OS: macOS 13.6.7
  CPU: (12) arm64 Apple M2 Pro
  Memory: 89.08 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.17.0
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.19
    path: /usr/local/bin/yarn
  npm:
    version: 10.9.1
    path: /usr/local/bin/npm
  Watchman:
    version: 2024.12.02.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.2
      - iOS 17.2
      - macOS 14.2
      - tvOS 17.2
      - visionOS 1.0
      - watchOS 10.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2022.3 AI-223.8836.35.2231.10406996
  Xcode:
    version: 15.2/15C500b
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.11
    path: /usr/bin/javac
  Ruby:
    version: 3.3.6
    path: /opt/homebrew/opt/ruby/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.6
    wanted: 0.73.6
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false
  • Platform that you're experiencing the issue on:
    • iOS
    • Android
    • iOS but have not tested behavior on Android
    • Android but have not tested behavior on iOS
    • Both
  • react-native-firebase version you're using that has this issue:
    • 21.12.2
  • Firebase module(s) you're using that has the issue:
    • Crashlytics
  • Are you using TypeScript?
    • N


@MichaelVerdon
Copy link
Collaborator

MichaelVerdon commented Mar 26, 2025

Hey there, It looks like your issue is here

2025-03-26 00:28:00.866 E  marvin-home[74052:1563c1d1] [com.google.firebase:[FirebaseCrashlytics]] 11.10.0 - [FirebaseCrashlytics][I-CLS000000] Found legacy data collection key in app's Info.plist: firebase_crashlytics_collection_enabled
2025-03-26 00:28:00.866 E  marvin-home[74052:1563c1d1] [com.google.firebase:[FirebaseCrashlytics]] 11.10.0 - [FirebaseCrashlytics][I-CLS000000] Please update your Info.plist to use the new data collection key: FirebaseCrashlyticsCollectionEnabled

Try putting this into your info.plist:

<key>FirebaseCrashlyticsCollectionEnabled</key>
<true/>

instead of

<key>firebase_crashlytics_collection_enabled</key>
<true/>

@mikehardy
Copy link
Collaborator

@enriquezc please follow this guide carefully - https://invertase.io/blog/react-native-firebase-crashlytics-configuration#testing-your-configuration and indicate which step is not working if none of that works.

There are quite a few reasons that iOS won't generate crash reports in testing - I can think of two immediately - but the doc goes over it all.

@MichaelVerdon I don't think that key is the problem however I was also unaware they had changed the key! So that's something to repair on our end

Additionally, this may be related to this PR which merged yesterday and I am releasing right now:

@enriquezc - you have perfectly up to date versions, thank you, however 21.12.3 is just being released, and I think when you work through the testing steps in the guide I wrote and linked above, you make sure you do it on this new 21.12.3 as it does contain a fix specifically in that area

@mikehardy
Copy link
Collaborator

mikehardy commented Mar 26, 2025

Strange, I inspected for that Info.plist key and I don't see it in our codebase. When we implemented that toggle it was already the updated value we say we should use:

https://github.com/search?q=repo%3Ainvertase%2Freact-native-firebase+FirebaseCrashlyticsCollectionEnabled&type=code

@enriquezc I would very very carefully check your Info.plist file, if you have anything manually in there related to things that are already controlled in firebase.json (like the crashlytics keys...) you should remove them. We have a script that takes firebase.json values, and then during pod install injects them into the final compiled Info.plist such that things are set up for you. This may also be the cause of your issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants