I saw these posts:
Error: RNFirebase core module was not found natively on iOS
RNFirebase core module was not found natively on iOS
RNFirebase core module was not found natively on iOS - Not fixed
Error message - RNFirebase core module was not found natively on iOS
None helped me. I am trying to upgrade from react-native-firebase v 5.6.0 to v6.
I followed the migration guide (https://rnfirebase.io/migrating-to-v6) but somehow my pods are not being installed.
If I add the RNFBApp pod manually like this
pod 'RNFBApp', :path => '../node_modules/@react-native-firebase/app'
Then I get this error
[!] CocoaPods could not find compatible versions for pod "Firebase/CoreOnly":
In snapshot (Podfile.lock):
Firebase/CoreOnly (= 6.3.0)
In Podfile:
RNFBApp (from `../node_modules/@react-native-firebase/app`) was resolved to 8.2.0, which depends on
Firebase/CoreOnly (~> 6.27.0)
You have either:
* changed the constraints of dependency `Firebase/CoreOnly` inside your development pod `RNFBApp`.
You should run `pod update Firebase/CoreOnly` to apply changes you've made.
Edit: Here is my Podfile:
# Uncomment the next line to define a global platform for your project
$RNFirebaseAsStaticFramework = true
platform :ios, '11.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
use_frameworks!
target 'project' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
#use_frameworks!
#use_modular_headers!
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 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
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/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
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'
pod 'RNCharts', :path => '../node_modules/react-native-charts-wrapper'
pod 'QBImagePickerController', :path => '../node_modules/react-native-image-crop-picker/ios/QBImagePicker/QBImagePickerController.podspec'
pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
pod 'RNImageCropPicker', :path => '../node_modules/react-native-image-crop-picker'
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
pod 'react-native-splash-screen', :path => '../node_modules/react-native-splash-screen'
pod 'react-native-netinfo', :path => '../node_modules/@react-native-community/netinfo'
pod 'Firebase'
# pod 'Firebase/Core', '~> 6.3.0'
# pod 'Firebase/Messaging'
# pod 'Firebase/Analytics'
# pod 'Firebase/DynamicLinks'
# pod 'Firebase/Messaging', '~> 6.27.0'
# FBSDK
# pod 'FBSDKCoreKit'
# pod 'FBSDKLoginKit'
# pod 'FBSDKShareKit'
# RNGestureHandler
# RNVectorIcons
pre_install do |installer|
installer.analysis_result.specifications.each do |s|
s.swift_version = '5.0' unless s.swift_version
end
end
#post_install do |installer|
# rnfirebase = installer.pods_project.targets.find { |target| target.name == 'RNFirebase' }
# rnfirebase.build_configurations.each do |config|
# config.build_settings['HEADER_SEARCH_PATHS'] = '$(inherited) ${PODS_ROOT}/Headers/Public/**'
# end
#end
use_native_modules!
end
If I do react-native run-ios
I get this message at the beginning, I think it has something to do with this problem:
error Could not find the following native modules: RNFBApp, RNFBMessaging, RNScreens. Did you forget to run "pod install" ?
If I don't add the RNFBApp pod manually I don't get any error during pod install but when I run the app in the simulator I get RNFirebase core module was not found natively on ios error.
Also, in package.json I see the below react-native-firebase dependencies:
"@react-native-firebase/app": "^8.2.0",
"@react-native-firebase/messaging": "^7.1.4",
React-native version is 0.61.2 so I am assuming auto-linking should be doing its thing.
I remove Podfile.lock file and Pods folder then I do pod install --repo-update
nothing changes.
Edit 2:
I was missing below 2 lines from my Podfile. Adding them made the podfile work.
Before the target 'project' do loop:
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
And at the end of the loop:
use_native_modules!
Also, I removed below lines from the podfile as suggested in the documentation(https://rnfirebase.io/migrating-to-v6#removing-v5-from-ios):
pod 'Firebase/Core', '~> 6.3.0'
I removed the line below since autolinking now seems to be working:
pod 'RNFBApp', :path => '../node_modules/@react-native-firebase/app'
Added below line to the top of the pod file as suggested in the documentation(https://rnfirebase.io/#allow-ios-static-frameworks) to solve the
target has transitive dependencies that include statically linked binaries: (FirebaseCore, FirebaseCoreDiagnostics, GoogleDataTransport, FirebaseInstallations, FirebaseMessaging, and FirebaseInstanceID)
problem.
$RNFirebaseAsStaticFramework = true
When I do a fresh pod install installation is completed successfully but when the app is launched in the simulator I still get rnfirebase core module was not found natively on ios error.
Documentation tells to remove RNFirebase pod (https://rnfirebase.io/migrating-to-v6#remove-the-rnfirebase-pod) but the app still seems to look for it and can't find it.
What could be the problem?
Thanks