Describe your issue here
I followed the instructions to install crashlytics and have had success in the past with the old instructions, but this method is not succeeding in reporting any data. In my same project, I have firestore and firebase working just fine, but for whatever reason crashlytics is not working.
I npm installed @react-native-firebase/crashlytics, ran both npx pod-install and cd ios && pod install but I'm not getting any data in iOS builds that were deployed via TestFlight. Maybe I'm doing something wrong here (certainly have in the past and will continue to) but maybe it's the new instructions?
Click To Expand
#### `package.json`:
{
"name": "app",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint .",
"clean:android": "cd android && ./gradlew clean && cd ../",
"clean:ios": "cd ios && xcodebuild clean && cd ../"
},
"dependencies": {
"@react-native-community/async-storage": "^1.11.0",
"@react-native-community/masked-view": "^0.1.10",
"@react-native-firebase/app": "^8.2.0",
"@react-native-firebase/auth": "^8.2.0",
"@react-native-firebase/crashlytics": "^8.1.2",
"@react-native-firebase/database": "^7.3.2",
"@react-native-firebase/firestore": "^7.4.3",
"@react-native-firebase/storage": "^7.2.2",
"@react-navigation/bottom-tabs": "^5.7.1",
"@react-navigation/drawer": "^5.8.5",
"@react-navigation/native": "^5.7.0",
"@react-navigation/stack": "^5.7.0",
"lodash.remove": "^4.7.0",
"react": "16.11.0",
"react-devtools": "^4.8.2",
"react-native": "0.62.2",
"react-native-elements": "^2.0.4",
"react-native-eva-icons": "^1.3.1",
"react-native-fbsdk": "^2.0.0",
"react-native-gesture-handler": "^1.6.1",
"react-native-image-picker": "^2.3.3",
"react-native-modal": "^11.5.6",
"react-native-picker-select": "^7.0.0",
"react-native-reanimated": "^1.9.0",
"react-native-safe-area-context": "^1.0.2",
"react-native-screens": "^2.9.0",
"react-native-simple-toast": "^1.1.2",
"react-native-splash-screen": "^3.2.0",
"react-native-svg": "^12.1.0",
"react-native-tiny-toast": "^1.0.7",
"react-native-vector-icons": "^7.0.0",
"react-redux": "^7.2.0",
"redux": "^4.0.5",
"redux-thunk": "^2.3.0",
"styled-components": "^5.1.1"
},
"devDependencies": {
"@babel/core": "^7.10.5",
"@babel/runtime": "^7.10.5",
"@react-native-community/eslint-config": "^1.1.0",
"babel-jest": "^26.1.0",
"eslint": "^7.4.0",
"jest": "^26.1.0",
"metro-react-native-babel-preset": "^0.59.0",
"react-test-renderer": "16.11.0"
},
"jest": {
"preset": "react-native"
}
}
#### `firebase.json` for react-native-firebase v6:
# N/A
### iOS
#### `ios/Podfile`: - [ ] I'm not using Pods - [x] I'm using Pods and my Podfile looks like:
platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
def add_flipper_pods!(versions = {})
versions['Flipper'] ||= '~> 0.33.1'
versions['DoubleConversion'] ||= '1.1.7'
versions['Flipper-Folly'] ||= '~> 2.1'
versions['Flipper-Glog'] ||= '0.3.6'
versions['Flipper-PeerTalk'] ||= '~> 0.0.4'
versions['Flipper-RSocket'] ||= '~> 1.0'
pod 'FlipperKit', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/FlipperKitLayoutPlugin', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/SKIOSNetworkPlugin', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/FlipperKitUserDefaultsPlugin', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/FlipperKitReactPlugin', versions['Flipper'], :configuration => 'Debug'
# List all transitive dependencies for FlipperKit pods
# to avoid them being linked in Release builds
pod 'Flipper', versions['Flipper'], :configuration => 'Debug'
pod 'Flipper-DoubleConversion', versions['DoubleConversion'], :configuration => 'Debug'
pod 'Flipper-Folly', versions['Flipper-Folly'], :configuration => 'Debug'
pod 'Flipper-Glog', versions['Flipper-Glog'], :configuration => 'Debug'
pod 'Flipper-PeerTalk', versions['Flipper-PeerTalk'], :configuration => 'Debug'
pod 'Flipper-RSocket', versions['Flipper-RSocket'], :configuration => 'Debug'
pod 'FlipperKit/Core', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/CppBridge', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/FBCxxFollyDynamicConvert', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/FBDefines', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/FKPortForwarding', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/FlipperKitHighlightOverlay', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/FlipperKitLayoutTextSearchable', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/FlipperKitNetworkPlugin', versions['Flipper'], :configuration => 'Debug'
end
# Post Install processing for Flipper
def flipper_post_install(installer)
installer.pods_project.targets.each do |target|
if target.name == 'YogaKit'
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.1'
end
end
end
end
target 'app' do
# Pods for app
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/'
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon"
pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga', :modular_headers => true
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
target 'appTests' do
inherit! :complete
# Pods for testing
end
use_native_modules!
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
add_flipper_pods!
post_install do |installer|
flipper_post_install(installer)
end
end
#### `AppDelegate.m`:
// N/A
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 -->
Click To Expand
**`react-native info` output:**
OUTPUT GOES HERE
- **Platform that you're experiencing the issue on**:
- [] iOS
- [ ] Android
- [x] **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:**
- `e.g. 5.4.3`
- **`Firebase` module(s) you're using that has the issue:**
- `e.g. Instance ID`
- **Are you using `TypeScript`?**
- `Y/N` & `VERSION`
React Native Firebase and Invertase on Twitter for updates on the library.Have you tried #3879
I just tried to add the firebase.json, but still not reporting any data unfortunately. Thanks for the head's up on that though @andersonaddo.
Crashlytics isn't real time; it takes a while (sometimes a whole day) for the reports to show up. Wait a while before you conclude it wasn't working.
@airowe were you able to resolve it? Even I'm facing the same issue.
@NareshMedipally this is an area of ongoing troubleshooting / collaboration and has some quirks right now. Just yesterday someone noticed that if you don't have a firebase.json you may not get debug reports
For now most successful path is up to date libraries, pod install, npx react-native-clean-project for clean build, release build on real device, do a test crash, restart the app (so the crash is sent), wait a bit (15mins? maybe longer it is not in our control), make sure your dSYMS are uploaded, check the console and make sure no reports are filtered
@mikehardy is correct, there are many moving parts involved. It doesn't help when the official way to crash app recommended by Firebase doesn't actually lead to a crash report: https://github.com/firebase/firebase-ios-sdk/issues/6028. This is also how react-native-firebase triggers manual crashes: https://github.com/invertase/react-native-firebase/blob/master/packages/crashlytics/ios/RNFBCrashlytics/RNFBCrashlyticsModule.m#L56
@mars-lan oh that's interesting! Nice link. This is a serious pain point here for lots of users, I'd welcome any PR that fixed this and successfully worked.
Strangely though when I use RNFB's manual crash test it actually works for me so I must have had the correct NODEBUG setting. So I didn't see it. That might help explain why iOS crash behavior has been so mysterious for people, with multiple problems combining and masking each other.
We just cleared the PR queue if you wanted to switch our crash trigger, make sure it works, and submit it, we'd have a release in hours not days/weeks
@mikehardy that's interesting. This is how I verified that assert(NO) doesn't work.
crashlytics().crash() from JS-FIRDebugEnabled & -FIRAnalyticsDebugEnabled to show verbose logI then repeat the above steps with a modified RNFB that crashes using @throw NSInternalInconsistencyException instead. This time the log clearly shows that a report was found and submitted.
That said, thus far I failed to get the submitted reports to show on Firebase dashboard for whatever reason. I'm pretty sure the correct DSYM has been submitted. :(
I am sad there is no :facepalm: emoji without an actual comment. You are clearly deep in this, and I'm sorry you're still not seeing success for the effort. All I can say is I know it is possible. Make sure you don't have filters on the dashboard (you probably don't at this point but just in case...) and then I dunno - more waiting perhaps but you've already waited hours.
Yup tested on a real device, disabled all filters in dashboard, set the timespan to last 24h, wait 1+ hour, nothing. The same thing just works magically for Android without a fuss 馃槥
However, the fact that log showed a successful submission makes me suspect that the problem lies with Firebase server side processing rather than RNFB.
If I understand correctly, @mikehardy you were able to crash and see reports on Firebase dashboard using the latest RNFB w/o modification?
Looks like the Firebase team has finally accepted https://github.com/firebase/firebase-ios-sdk/issues/6028 and updated their doc: https://firebase.google.com/docs/crashlytics/test-implementation?platform=ios
Will prepare a PR for the same on RNFB side.
I'll do a release with that fix (already merged - @mars-lan :trophy: !) in just a couple hours...
We believe this is resolved, this thread here was quite useful but there is more info on this thread: https://github.com/invertase/react-native-firebase/issues/3879#issuecomment-678389795 - we will reopen there if it continues
Confirmed that 8.2.3 is working and that reporting lag is real (~ 2h for me).
That said, the "fix" I did in https://github.com/invertase/react-native-firebase/pull/4111 wasn't exactly ideal. The new recommended "array index out of bond" way to crash will be caught by RN and presented as a red box when running in debug mode. @mikehardy WDYT if we change it to something that's not catchable, e.g. NSInternalInconsistencyException as recommended here, so people can test it in debug builds?
@mars-lan sure - getting a red box instead of a crash is not the desired outcome so if there is a more thorough way that would be a refinement. A comment with the recommended solution and why we differ from it would be perfect in the code