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.74k stars 2.22k forks source link

[🐛] react native fails with 'react/bridging/CallbackWrapper.h' file not found after following getting started guide #7128

Closed victororlyk closed 1 year ago

victororlyk commented 1 year ago

Issue

I am trying to setup react native and firebase push notifications, I am following this guide. https://rnfirebase.io/messaging/usage after pod install I am always getting failing build.

It fails most often with

'react/bridging/CallbackWrapper.h' file not found

If i will remove everything from this guide getting started(https://rnfirebase.io/) , the build will work


Project Files

Javascript

Click To Expand

#### `package.json`: ```json { "name": "app", "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", "start::clearCache": "yarn start --reset-cache" }, "dependencies": { "@hookform/resolvers": "^3.0.0", "@react-native-async-storage/async-storage": "^1.17.12", "@react-native-firebase/app": "^17.4.2", "@react-native-firebase/messaging": "^17.4.2", "@react-native-picker/picker": "^2.4.9", "@react-navigation/bottom-tabs": "^6.5.7", "@react-navigation/native": "^6.1.6", "@react-navigation/native-stack": "^6.9.12", "@shopify/react-native-skia": "^0.1.185", "@tanstack/react-query": "^4.28.0", "axios": "^1.3.4", "classnames": "^2.3.2", "d3": "^7.8.4", "date-fns": "^2.29.3", "jotai": "^2.0.3", "nativewind": "^2.0.11", "react": "18.2.0", "react-hook-form": "^7.43.9", "react-native": "^0.71.0", "react-native-biometrics": "^3.0.1", "react-native-email-link": "^1.14.5", "react-native-gesture-handler": "^2.9.0", "react-native-haptic-feedback": "^2.0.2", "react-native-localize": "^2.2.6", "react-native-plaid-link-sdk": "^10.1.0", "react-native-reanimated": "^3.1.0", "react-native-restart": "^0.0.27", "react-native-safe-area-context": "^4.5.0", "react-native-screens": "^3.20.0", "react-native-splash-screen": "^3.3.0", "react-native-vector-icons": "^9.2.0", "react-native-webview": "^12.0.2", "zod": "^3.21.4" }, "devDependencies": { "@babel/core": "^7.21.4", "@babel/preset-env": "^7.21.4", "@babel/runtime": "^7.21.0", "@react-native-community/eslint-config": "^3.2.0", "@total-typescript/ts-reset": "^0.4.2", "@tsconfig/react-native": "^2.0.2", "@types/d3": "^7.4.0", "@types/jest": "^29.5.0", "@types/react": "^18.0.24", "@types/react-native-vector-icons": "^6.4.13", "@types/react-test-renderer": "^18.0.0", "babel-jest": "^29.5.0", "babel-plugin-module-resolver": "^5.0.0", "eslint": "^8.37.0", "eslint-plugin-ft-flow": "^2.0.3", "eslint-plugin-simple-import-sort": "^10.0.0", "jest": "^29.5.0", "metro-react-native-babel-preset": "0.73.8", "prettier": "^2.8.7", "prettier-plugin-tailwindcss": "^0.2.7", "react-native-dotenv": "^3.4.8", "react-test-renderer": "18.2.0", "tailwindcss": "^3.3.1", "typescript": "^5.0.3" }, "jest": { "preset": "react-native" } } ``` #### `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 require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' platform :ios, min_ios_version_supported prepare_react_native_project! # 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 'subsidio' do config = use_native_modules! # Flags change depending on the env values. flags = get_default_flags() use_react_native!( :path => config[:reactNativePath], # Hermes is now enabled by default. Disable by setting this flag to false. # Upcoming versions of React Native may rely on get_default_flags(), but # we make it explicit here to aid in the React Native upgrade process. :hermes_enabled => flags[:hermes_enabled], :fabric_enabled => flags[:fabric_enabled], # 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}/.." ) # Firebase # use_frameworks! :linkage => :dynamic # Change from static to dynamic use_frameworks! :linkage => :static $RNFirebaseAsStaticFramework = true # Add the Firebase pods you need below this line pod 'Firebase/Core' # Add other Firebase pods if required target 'subsidioTests' do inherit! :complete # Pods for testing end post_install do |installer| react_native_post_install( installer, # Set `mac_catalyst_enabled` to `true` in order to apply patches # necessary for Mac Catalyst builds :mac_catalyst_enabled => false ) __apply_Xcode_12_5_M1_post_install_workaround(installer) end end ``` #### `AppDelegate.mm`: ```objc #import "AppDelegate.h" #import //firebase /// Deep linking #import #import @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [FIRApp configure]; //firebase self.moduleName = @"subsidio"; // 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 [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; #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; } /// Deep linking - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary *)options { return [RCTLinkingManager application:application openURL:url options:options]; } @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:** ``` OUTPUT GOES HERE ``` - **Platform that you're experiencing the issue on**: - [x] 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:** - `17.4.2` - **`Firebase` module(s) you're using that has the issue:** - `@react-native-firebase/app` - `@react-native-firebase/messaging` - **Are you using `TypeScript`?** - `Yes` & `5.0.3`


here is error file Build app_2023-05-22T13-36-15.txt

github-actions[bot] commented 1 year ago

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.