invertase / react-native-firebase

πŸ”₯ A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.
https://rnfirebase.io
Other
11.65k stars 2.21k forks source link

[πŸ›] πŸ”₯ Crashing on iOS #8034

Open AndreyBernardoni opened 9 hours ago

AndreyBernardoni commented 9 hours ago

Issue

I'm doing a React Native version migration. My project was on version 0.72.14 and it worked perfectly. I created a new project in version 0.75.3 and am slowly migrating the components. I redid the Firebase App installation steps and in version 0.75.3 my application crashes when opening in the iOS simulator. Sorry for the translation, I will respond quickly if you have any questions.


Project Files

Javascript

Click To Expand

#### `package.json`: ```json { "name": "Medical", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "lint": "eslint .", "start": "react-native start", "test": "jest", "postinstall": "patch-package" }, "dependencies": { "@notifee/react-native": "^7.8.2", "@react-native-community/datetimepicker": "^8.2.0", "@react-native-community/netinfo": "^11.3.2", "@react-native-firebase/app": "^20.4.0", "@react-native-firebase/messaging": "^20.4.0", "@react-native-voice/voice": "^3.2.4", "@react-navigation/native": "^6.1.7", "@react-navigation/native-stack": "^6.9.13", "axios": "1.7.5", "gpt4js": "^1.7.7", "patch-package": "^8.0.0", "react": "18.3.1", "react-dom": "^18.3.1", "react-native": "0.75.3", "react-native-async-storage": "^0.0.1", "react-native-calendars": "^1.1305.0", "react-native-code-input": "^1.0.6", "react-native-date-picker": "^5.0.4", "react-native-dropdown-picker": "^5.4.6", "react-native-elements": "^3.4.3", "react-native-fast-image": "^8.6.3", "react-native-gesture-handler": "^2.17.1", "react-native-mmkv": "^2.12.2", "react-native-reanimated": "^3.14.0", "react-native-reanimated-carousel": "^3.5.1", "react-native-safe-area-context": "^4.7.2", "react-native-screens": "^3.25.0", "react-native-swiper-flatlist": "^3.2.4", "react-native-tts": "^4.1.1", "react-native-userpic": "^2.0.3", "react-native-vector-icons": "^10.0.0", "react-smart-layout": "^1.0.1", "zustand": "^4.5.2", "zustand-persist": "^0.4.0" }, "devDependencies": { "@babel/core": "^7.20.0", "@babel/preset-env": "^7.20.0", "@babel/runtime": "^7.20.0", "@react-native/babel-preset": "0.75.3", "@react-native/eslint-config": "0.75.3", "@react-native/metro-config": "0.75.3", "@react-native/typescript-config": "0.75.3", "@types/react": "^18.2.6", "@types/react-native-vector-icons": "^6.4.14", "@types/react-test-renderer": "^18.0.0", "babel-jest": "^29.6.3", "eslint": "^8.19.0", "jest": "^29.6.3", "prettier": "2.8.8", "react-test-renderer": "18.3.1", "typescript": "5.0.4" }, "engines": { "node": ">=18" }, "packageManager": "yarn@3.6.4" } ```

iOS

Click To Expand

#### `ios/Podfile`: - [ ] I'm not using Pods - [x] I'm using Pods and my Podfile looks like: ```ruby # 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 platform :ios, min_ios_version_supported prepare_react_native_project! 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 'Medical' do config = use_native_modules! use_frameworks! :linkage => :static $RNFirebaseAsStaticFramework = true use_react_native!( :path => config[:reactNativePath], # An absolute path to your application root. :app_path => "#{Pod::Config.instance.installation_root}/.." ) target 'MedicalTests' 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, # :ccache_enabled => true ) end end ``` #### `AppDelegate.mm`: ```objc #import "AppDelegate.h" #import #import @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [FIRApp configure]; self.moduleName = @"Medical"; // 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 { return [self bundleURL]; } - (NSURL *)bundleURL { #if DEBUG return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"]; #else return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; #endif } @end ```

StackTrace

Click To Expand

``` ------------------------------------- Translated Report (Full Report Below) ------------------------------------- Incident Identifier: 35BE04EB-9BDE-4A0C-B3E2-B099F367CD7F CrashReporter Key: ED3501FA-CE51-9197-A4E6-0DAE0A096D18 Hardware Model: Mac14,2 Process: Medical [20221] Path: /Users/USER/Library/Developer/CoreSimulator/Devices/2B5DBF7B-3DA3-4917-BC89-D8F9E25D9BD2/data/Containers/Bundle/Application/A74886E7-5075-4491-B1D4-3D76A7327DBB/Medical.app/Medical Identifier: org.reactjs.native.example.Medical Version: 1.0 (1) Code Type: ARM-64 (Native) Role: Foreground Parent Process: launchd_sim [2729] Coalition: com.apple.CoreSimulator.SimDevice.2B5DBF7B-3DA3-4917-BC89-D8F9E25D9BD2 [1270] Responsible Process: SimulatorTrampoline [2721] Date/Time: 2024-09-24 23:28:09.9776 -0300 Launch Time: 2024-09-24 23:28:06.7758 -0300 OS Version: macOS 14.6.1 (23G93) Release Type: User Report Version: 104 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: SIGNAL 6 Abort trap: 6 Terminating Process: Medical [20221] Triggered by Thread: 0 Last Exception Backtrace: 0 CoreFoundation 0x10964889c __exceptionPreprocess + 160 1 libobjc.A.dylib 0x107a0c09c objc_exception_throw + 56 2 CoreFoundation 0x1096487b8 -[NSException initWithCoder:] + 0 3 Medical 0x10471ffb8 +[FIRApp configure] + 128 4 Medical 0x1046ada0c -[AppDelegate application:didFinishLaunchingWithOptions:] + 76 (AppDelegate.mm:10) 5 UIKitCore 0x1275849d0 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 312 6 UIKitCore 0x127585e30 -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 2788 7 UIKitCore 0x12758a974 -[UIApplication _runWithMainScene:transitionContext:completion:] + 856 8 UIKitCore 0x126c46e08 -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 104 9 UIKitCore 0x12715679c _UIScenePerformActionsWithLifecycleActionMask + 96 10 UIKitCore 0x126c47708 __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 188 11 UIKitCore 0x126c4727c -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 212 12 UIKitCore 0x126c47560 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 576 13 UIKitCore 0x126c46f64 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 244 14 UIKitCore 0x126c505f8 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 140 15 UIKitCore 0x127059170 +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:fromCurrentState:actions:completion:] + 656 16 UIKitCore 0x12716c950 _UISceneSettingsDiffActionPerformChangesWithTransitionContextAndCompletion + 196 17 UIKitCore 0x126c50304 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 288 18 UIKitCore 0x126ab21c4 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke.198 + 608 19 UIKitCore 0x126ab0f74 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 208 20 UIKitCore 0x126ab1e48 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 220 21 UIKitCore 0x1275896a4 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 484 22 UIKitCore 0x127080704 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 260 23 FrontBoardServices 0x116a3c014 -[FBSScene _callOutQueue_didCreateWithTransitionContext:completion:] + 296 24 FrontBoardServices 0x116a64acc __92-[FBSWorkspaceScenesClient createSceneWithIdentity:parameters:transitionContext:completion:]_block_invoke.82 + 224 25 FrontBoardServices 0x116a48bb4 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 160 26 FrontBoardServices 0x116a64844 __92-[FBSWorkspaceScenesClient createSceneWithIdentity:parameters:transitionContext:completion:]_block_invoke + 284 27 libdispatch.dylib 0x10d503d3c _dispatch_client_callout + 16 28 libdispatch.dylib 0x10d507c4c _dispatch_block_invoke_direct + 376 29 FrontBoardServices 0x116a87fa0 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 44 30 FrontBoardServices 0x116a87e7c -[FBSMainRunLoopSerialQueue _targetQueue_performNextIfPossible] + 196 31 FrontBoardServices 0x116a87fd4 -[FBSMainRunLoopSerialQueue _performNextFromRunLoopSource] + 24 32 CoreFoundation 0x1095a969c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24 33 CoreFoundation 0x1095a95e4 __CFRunLoopDoSource0 + 172 34 CoreFoundation 0x1095a8d54 __CFRunLoopDoSources0 + 232 35 CoreFoundation 0x1095a343c __CFRunLoopRun + 768 36 CoreFoundation 0x1095a2d28 CFRunLoopRunSpecific + 572 37 GraphicsServices 0x118c5fbc0 GSEventRunModal + 160 38 UIKitCore 0x127587fdc -[UIApplication _run] + 868 39 UIKitCore 0x12758bc54 UIApplicationMain + 124 40 Medical 0x1046adc60 main + 96 (main.m:8) 41 dyld_sim 0x10795d558 start_sim + 20 42 dyld 0x107a66154 start + 2476 43 ??? 0x186a800000000000 ??? Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x10f3acf30 __pthread_kill + 8 1 libsystem_pthread.dylib 0x10f413124 pthread_kill + 256 2 libsystem_c.dylib 0x10f2965ec abort + 104 3 libc++abi.dylib 0x107917c78 abort_message + 128 4 libc++abi.dylib 0x107909198 demangling_terminate_handler() + 300 5 libobjc.A.dylib 0x1079e7bf0 _objc_terminate() + 124 6 libc++abi.dylib 0x107917150 std::__terminate(void (*)()) + 12 7 libc++abi.dylib 0x107917100 std::terminate() + 52 8 libdispatch.dylib 0x10d503d50 _dispatch_client_callout + 36 9 libdispatch.dylib 0x10d507c4c _dispatch_block_invoke_direct + 376 10 FrontBoardServices 0x116a87fa0 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 44 11 FrontBoardServices 0x116a87e7c -[FBSMainRunLoopSerialQueue _targetQueue_performNextIfPossible] + 196 12 FrontBoardServices 0x116a87fd4 -[FBSMainRunLoopSerialQueue _performNextFromRunLoopSource] + 24 13 CoreFoundation 0x1095a969c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24 14 CoreFoundation 0x1095a95e4 __CFRunLoopDoSource0 + 172 15 CoreFoundation 0x1095a8d54 __CFRunLoopDoSources0 + 232 16 CoreFoundation 0x1095a343c __CFRunLoopRun + 768 17 CoreFoundation 0x1095a2d28 CFRunLoopRunSpecific + 572 18 GraphicsServices 0x118c5fbc0 GSEventRunModal + 160 19 UIKitCore 0x127587fdc -[UIApplication _run] + 868 20 UIKitCore 0x12758bc54 UIApplicationMain + 124 21 Medical 0x1046adc60 main + 96 (main.m:8) 22 dyld_sim 0x10795d558 start_sim + 20 23 dyld 0x107a66154 start + 2476 ```


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:** ``` System: OS: macOS 14.6.1 CPU: (8) arm64 Apple M2 Memory: 158.98 MB / 8.00 GB Shell: version: "5.9" path: /bin/zsh Binaries: Node: version: 22.4.0 path: /opt/homebrew/bin/node Yarn: version: 3.6.4 path: /opt/homebrew/bin/yarn npm: version: 10.8.1 path: /opt/homebrew/bin/npm Watchman: version: 2024.08.19.00 path: /opt/homebrew/bin/watchman Managers: CocoaPods: version: 1.15.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: API Levels: - "31" - "33" - "34" - "35" Build Tools: - 30.0.3 - 33.0.0 - 33.0.1 - 34.0.0 - 35.0.0 System Images: - android-34 | Intel x86_64 Atom - android-34 | Google APIs ARM 64 v8a - android-35 | Google Play ARM 64 v8a Android NDK: Not Found IDEs: Android Studio: 2024.1 AI-241.15989.150.2411.11948838 Xcode: version: 15.2/15C500b path: /usr/bin/xcodebuild Languages: Java: version: 17.0.11 path: /usr/bin/javac Ruby: version: 2.6.10 path: /usr/bin/ruby npmPackages: "@react-native-community/cli": Not Found react: installed: 18.3.1 wanted: 18.3.1 react-native: installed: 0.75.3 wanted: 0.75.3 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 - [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:** - `^20.4.0` - **`Firebase` module(s) you're using that has the issue:** - `e.g. Instance ID` - **Are you using `TypeScript`?** - `Y` & `5.0.4`


mikehardy commented 9 hours ago

Very strange. I have no problem demonstrating build/run success with current react-native -> https://github.com/mikehardy/rnfbdemo/blob/main/make-demo.sh

I wonder if you are missing the GoogleServices-Info.plist file or similar ? πŸ€”

AndreyBernardoni commented 8 hours ago
image

Not really, my GoogleServices-Info.plist is here.

I followed the steps and re-downloaded the necessary files.

By the way, thank you for your very quick response.

mikehardy commented 48 minutes ago

Still strange, all I can say is - my build demonstrator starts from scratch and has reproducible success every time, so we have a reproducibility time