7

Package.json

"dependencies": {
    "@react-native-async-storage/async-storage": "^2.0.0",
    "@react-native-firebase/app": "^21.4.0",
    "@react-native-firebase/auth": "^21.4.0",
    "@react-native-firebase/firestore": "^21.4.0",
    "@react-navigation/bottom-tabs": "^6.5.0",
    "@react-navigation/native": "^6.1.0",
    "@react-navigation/native-stack": "^6.9.0",
    "axios": "^1.7.7",
    "firebase": "^11.0.1",
    "react": "18.3.1",
    "react-native": "0.75.4",
    "react-native-calendars": "^1.1307.0",
    "react-native-get-random-values": "^1.11.0",
    "react-native-paper": "^5.12.5",
    "react-native-safe-area-context": "^4.11.1",
    "react-native-screens": "^4.0.0",
    "react-native-svg": "^15.8.0",
    "react-native-vector-icons": "^10.2.0",
    "react-native-video": "^6.7.0",
    "react-native-webview": "^13.12.3",
    "uuid": "^11.0.2"
  },

Podfile

# 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, '14.0'  
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 'app' do
  use_frameworks! :linkage => :static
  $RNFirebaseAsStaticFramework = true

  config = use_native_modules!


  use_modular_headers!
  pod 'RNFBApp', path: '../node_modules/@react-native-firebase/app'
  pod 'FirebaseCore', :modular_headers => true
  pod 'FirebaseCoreExtension', :modular_headers => true
  pod 'FirebaseInstallations', :modular_headers => true
  pod 'GoogleDataTransport', :modular_headers => true
  pod 'GoogleUtilities', :modular_headers => true
  pod 'nanopb', :modular_headers => true
  use_react_native!(
    :path => config[:reactNativePath],
   
    :hermes_enabled => true,
    :fabric_enabled => true,
   
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  

  target 'apptest' 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,
     
    )

   
    
  end
end

I made some additions to my Podfile as recommended on the React Native Firebase website. I noticed that some Firebase files were missing, so I added them. However, despite providing the path for the RNFBApp module, it still appears to be missing. I have tried running pod install --repo-update and deleting the Podfile.lock and Pods directory before reinstalling, but this issue persists.

5 Answers 5

11

I encountered the same issue after installing @react-native-firebase/app version 21.4.0. To resolve it, I downgraded @react-native-firebase/app, @react-native-firebase/auth, and @react-native-firebase/firestore to version 19.0.0. After the downgrade, everything worked fine for me at the time.

Important note: Downgrading is not a long-term or recommended solution. It may lead to incompatibility with the latest React Native versions and loss of official support.

For a proper and up-to-date fix, please refer to the GitHub issue

Thanks to @mike-hardy and others in the community for clarifying the best practices.

Sign up to request clarification or add additional context in comments.

7 Comments

I had the same problem when using React native expo. I downloaded 21.4.0 from 19.0.0 and the problem is solved
Downgrading is just a temporary solution as latest react-native requires upgrading to v21 to be able to build. Please follow the conversation in GitHub, suggesting to mock react-native: github.com/invertase/react-native-firebase/issues/8189
Downgrading should never be accepted as a solution. Downvote from your react-native-firebase maintainer here...
@anushree-more if at all possibly you really should edit your answer and let people know that downgrading is the last thing you should possibly try. I've posted a more complete answer below for Expo users and we continuously improve our documentation (with the help of Expo users...). I consider your answer actively harmful as downgrades mean people won't be able to access support since they are not on current versions
I completely understand that downgrading isn't a long-term solution, and I’m not suggesting it as one. At the time, when this issue occurred, downgrading worked as a quick fix for me. For anyone facing the same issue, I recommend checking the latest updates from the maintainers for a proper fix. Thanks for the clarification, @MikeHardy
|
7

react-native-firebase maintainer here, howdy.

I need to be 100% crystal clear for anyone reading this - any use of modular_headers will mean support is denied for whatever problem you are having.

Those directives in your Podfile are invalid and must be removed to access support.

Our underlying native iOS SDK from google - firebase-ios-sdk - strictly requires use_frameworks! in your Podfile, and in a react-native context we have to add on just a bit and require use_frameworks! :linkage => :static

Remove all modular_headers items, make sure you have enabled use_frameworks! :linkage => :static, then pod install and npx react-native run-ios (so it recompiles...) again and the native modules should be present.

I maintain a build demonstration script that starts from the raw react-native template and fully integrates react-native-firebase - including all Podfile modifications required - and results in a successfully building project every time. You may investigate it yourself in case that helps show what you need to build react-native-firebase correctly:

https://github.com/mikehardy/rnfbdemo/blob/main/make-demo.sh


Separate problem entirely but this question shows up on searches for it:

For people searching here because you see the same message when you attempt to use react-native-firebase with Expo, and you have used npx expo run, you must realize that relies on the pre-compiled "Expo Go" app. It does not contain react-native-firebase modules built in to it and so it will never work. Repeat, npx expo run will never work.

For Expo people, you need to uninstall any existing Expo Go version of the app, do an expo prebuild, then local compilation steps as we document here https://rnfirebase.io/#local-app-compilation

7 Comments

Amusing you all downvoting my answer when I am literally the person maintaining the software you are using :-) - I'm just telling you what our requirements are based on requirements I have zero control over because they're upstream. You can feel how you like about it but those are the facts :shrug:
Ugh thanks Mike, I've been using RNFB in another project fine and suddenly ran into the separate problem you mentioned. Expo Go was totally the issue, and it kept getting installed even after I did expo prebuild --clean. Turns out all I needed was to install the missing expo-dev-client dependency to use development client instead of Expo Go.
this problem occurs on Android too, only iOS
@damdafayton a strict interpretation of your statement is that there are pod install errors on Android. That makes no sense. If you haven't read the "how to ask" and "minimum viable reproduction" pages of stack overflow you should do so. Then you should out them in practice so I or anyone could actually help
a normal interpretation of my statement is that your solution is not correct because it assumes the problem is iOS related. i just advise you to use an LLM to help you understand the context.
|
5

The solution is the following:

  1. Make sure you have downloaded your ios and android config files, updated your app.json to point to them
  2. Add appropriate plugins and expo-build-properties to app.json (as documented https://rnfirebase.io/#expo)
  3. Install the expo-build-properties package (This is not documented anywhere, but it is required)
  4. Run npx expo prebuild --clean
  5. Run: npx expo run:ios --device. You must do this before using npx expo start. This is also not documented anywhere I can see. Remove --device if you plan to use simulator.

This produced a working build on my device that does not require making any changes to the ios directory to include mention of static linkage, etc.

Quite frankly, the Firebase setup documentation is a total mess. It barely mentions versions anywhere. Half the steps aren't required, and some that are required are missing completely.

6 Comments

Running npx expo run:ios after npx expo prebuild --clean solved the problem in my case. Thanks a lot!
Just to note @entangledloops, you are documenting expo steps, and expo-build-properties, but the original poster does not have expo in the dependencies of their package.json - I'll further note there's an edit button top right of every page, if things are incorrect, please post a PR, happy to collaborate
Hi Mike, you are correct about me including expo. However, I have a lot to say about this. Bare JS react projects and those that do not use expo are essentially unsupported at this time (despite whatever the docs say). You are now forced to use Typescript and Expo if you want a working project for many reasons. Firebase setup is extremely complex otherwise and also fragile. Using bare JS is also prone to break now as expo-router doesn't like JS navigation files (despite claimed support), and project structure has changed dramatically between react releases. Too much to explain in this comment.
You can imagine as the maintainer of a bunch of packages I have a lot of thoughts as well. Regardless, I believe on stackoverflow it's encouraged to answer the original poster's question as specified. They're not using expo, the question isn't about Expo, yet you gave an expo-specific answer. That doesn't match for me, regardless of how much everyone should use Expo or not
@EntangledLoops thanks for your answer. i would have been lost without your answer.
|
4

Had the same issue, I'm using expo and plugins config, meaning I did not edit any platform related files, I solved it by uninstalling the app first from my simulator, then running the expo prebuild --clean and expo run:ios.

--clean will remove your ios files and rebuild them

1 Comment

Thanks @patchimou - a user linked your comment from the related issue in our repo as the "uninstalling the app first" step wasn't mentioned and it saved someone lots of time. I added it to our expo local app compilation section linked in my answer above
0

If you’re using React Native Firebase in an Expo project and run into:

Error: Native module RNFBAppModule not found.
Re-check module install, linking, configuration, build and install steps.

It usually means the native files (iOS/Android) required for Firebase haven’t been generated yet. Here’s how to fix it:

Current Versions:

   "@react-native-firebase/app": "^23.2.0",
   "@react-native-firebase/messaging": "^23.2.0",

1. Prebuild your Expo project

Since Firebase requires native modules, you need to generate the native iOS and Android directories:

npx expo prebuild

This will create the ios and android folders inside your project.

2. Test on a real device (not just Expo Go)

React Native Firebase doesn’t work with Expo Go, because Expo Go doesn’t include Firebase native code.

You must build and install your own development client, then run it on a physical device or emulator.

3. Run the app with native build

Use React Native CLI to build and install your app:

For Android:

npx react-native run-android

For iOS:

npx react-native run-ios

In summary:

- expo prebuild → generates native code.
- Must use custom dev client (not Expo Go).
- Run with react-native run-android or react-native run-ios on a device/emulator.

This resolves the RNFBAppModule not found error.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.