Closed nbonatsakis closed 5 months ago
Looks like a slightly different crash log, but you're describing exactly what I and others are seeing:
https://github.com/invertase/react-native-firebase/issues/7697 https://github.com/invertase/react-native-firebase/issues/7695
I hope this gets looked at soon.
@rgomezp this crash trace looks very different
@nbonatsakis what happens when you use the current version here? it includes a new native firebase-ios-sdk version and may contain a fix
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.
Issue
Describe your issue here
We are seeing a high level of crashes in a production React Native app (around 1% of all users). The stack traces are slightly different across all crashes, but they all end up resulting in an illegal argument exception being thrown when the settings object is copied (copyWithZone). Based on my reading of the code, it seems like the Firestore code is trying to access the Firestore Settings object and for some reason, in these cases it is nil.
We are using basic Firestore functionality (collections and bundles) that get initialized on app open.
Stack trace example:
Project Files
Javascript
Click To Expand
#### `package.json`: ```json { "@react-native-firebase/analytics": "^18.6.1", "@react-native-firebase/app": "^18.6.1", "@react-native-firebase/auth": "^18.6.1", "@react-native-firebase/crashlytics": "^18.6.1", "@react-native-firebase/dynamic-links": "^18.6.1", "@react-native-firebase/firestore": "^18.6.1", "@react-native-firebase/functions": "^18.6.1", "@react-native-firebase/installations": "^18.6.1", "@react-native-firebase/messaging": "^18.6.1", "@react-native-firebase/perf": "^18.6.1", "@react-native-firebase/remote-config": "^18.6.1", } ``` #### `firebase.json` for react-native-firebase v6: ```json # N/A ```
iOS
Click To Expand
#### `ios/Podfile`: - [ ] I'm not using Pods - [x] I'm using Pods and my Podfile looks like: ```ruby ######################################## # Start React Native Firebase setup ######################################## $RNFirebaseAsStaticFramework = true # Disable IDFA collection by Firebase $RNFirebaseAnalyticsWithoutAdIdSupport = true ######################################## # Finish React Native Firebase setup ######################################## ``` #### `AppDelegate.m`: ```objc /@implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Initialise Firebase [FIRApp configure]; // Firebase Dynamic links fix: // Currently, iOS requires a workaround to make method swizzling work. // https://github.com/invertase/react-native-firebase/issues/4548#issuecomment-1252028059 [RNFBDynamicLinksAppDelegateInterceptor sharedInstance]; // TODO: It may not be appropriate to use the same API Key as Firebase [GMSServices provideAPIKey:[[[FIRApp defaultApp] options] APIKey]]; self.moduleName = @"MyApp"; // 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]; } - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge { #if DEBUG return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"]; #else return [CodePush bundleURL]; #endif } /// This method controls whether the `concurrentRoot`feature of React18 is turned on or off. /// /// @see: https://reactjs.org/blog/2022/03/29/react-v18.html /// @note: This requires to be rendering on Fabric (i.e. on the New Architecture). /// @return: `true` if the `concurrentRoot` feature is enabled. Otherwise, it returns `false`. - (BOOL)concurrentRootEnabled { return true; } // react-native-bootsplash - (UIView *)createRootViewWithBridge:(RCTBridge *)bridge moduleName:(NSString *)moduleName initProps:(NSDictionary *)initProps { UIView *rootView = [super createRootViewWithBridge:bridge moduleName:moduleName initProps:initProps]; [RNBootSplash initWithStoryboard:@"BootSplash" rootView:rootView]; return rootView; } @end ```
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`: ```groovy // N/A ``` #### `android/app/build.gradle`: ```groovy // N/A ``` #### `android/settings.gradle`: ```groovy // N/A ``` #### `MainApplication.java`: ```java // N/A ``` #### `AndroidManifest.xml`: ```xml ```
Environment
Click To Expand
**`react-native info` output:** ``` info Fetching system and libraries information... System: OS: macOS 14.2.1 CPU: (12) arm64 Apple M2 Pro Memory: 191.09 MB / 32.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 18.19.0 - /opt/homebrew/opt/node@18/bin/node Yarn: Not Found npm: 10.2.3 - /opt/homebrew/opt/node@18/bin/npm Watchman: Not Found Managers: CocoaPods: 1.12.1 - /Users/nick/.rvm/gems/ruby-3.2.2/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: 2023.1 AI-231.9392.1.2311.11255304 Xcode: 15.2/15C500b - /usr/bin/xcodebuild Languages: Java: 11.0.21 - /opt/homebrew/opt/openjdk@11/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.2.0 => 18.2.0 react-native: ^0.71.14 => 0.71.14 react-native-macos: Not Found npmGlobalPackages: *react-native*: Not Found ``` - **Platform that you're experiencing the issue on**: - [ x] 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:** - `18.6.1` - **`Firebase` module(s) you're using that has the issue:** - `firestore` - **Are you using `TypeScript`?** - `Y 5.1.0`
React Native Firebase
andInvertase
on Twitter for updates on the library.