Home > other >  Can't pod install firebase. This error occurs: No podspec found for `RNFirebase`
Can't pod install firebase. This error occurs: No podspec found for `RNFirebase`

Time:02-03

I run pod install in src/ios/ directory and it says this:

No podspec found for `RNFirebase` in `../node_modules/react-native-firebase`

The thing is that it worked before, now it doesn't and I don't know why really.

This is my Podfile:

platform :ios, '11.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target '<App_Name>' do
  # Pods for <App_Name>
  pod 'Firebase/Core', '~> 6.13.0'
  pod 'Firebase/Messaging', '~> 6.13.0'
  pod 'Firebase/Analytics'
  # Required by RNFirebase v5 Crashlytics
  pod 'Fabric', '~> 1.9.0'
  pod 'Crashlytics', '~> 3.12.0'

  pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
  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 '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 'Firebase/DynamicLinks', '~> 6.13.0'
  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/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
  pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
  pod 'RNAppleAuthentication', :path => '../node_modules/@invertase/react-native-apple-authentication'
  pod 'RNCPicker', :path => '../node_modules/@react-native-community/picker'
  pod 'react-native-fbsdk', :path => '../node_modules/react-native-fbsdk'
  pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
  pod 'RNGoogleSignin', :path => '../node_modules/react-native-google-signin'
  pod 'react-native-ibm-mobilefirst', :path => '../node_modules/react-native-ibm-mobilefirst'
  pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'

  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 'react-native-google-maps', path: '../node_modules/react-native-maps' # <~~ if you need GoogleMaps support on iOS
  pod 'GoogleMaps'  # Uncomment this line if you want to support GoogleMaps on iOS
  pod 'Google-Maps-iOS-Utils' # Uncomment this line if you want to support GoogleMaps on iOS
  
 





  # pod 'RNFirebase/Crashlytics', :path => '../node_modules/react-native-firebase/ios'



  pod 'lottie-ios', :path => '../node_modules/lottie-ios'


  pod 'Firebase/Auth', '~> 6.13.0'
  
  pod 'RNFastImage', :path => '../node_modules/react-native-fast-image'

  pod 'ReactNativeNavigation', :path => '../node_modules/react-native-navigation'

  pod 'react-native-geolocation-service', :path => '../node_modules/react-native-geolocation-service'

  pod 'lottie-react-native', :path => '../node_modules/lottie-react-native'

  pod 'react-native-webview', :path => '../node_modules/react-native-webview'

  pod 'RNInAppBrowser', :path => '../node_modules/react-native-inappbrowser-reborn'

  pod 'react-native-maps', :path => '../node_modules/react-native-maps'

  pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-community/async-storage'

  pod 'react-native-netinfo', :path => '../node_modules/@react-native-community/netinfo'

  pod 'react-native-geolocation', :path => '../node_modules/@react-native-community/geolocation'

  pod 'RNFirebase', :path => '../node_modules/react-native-firebase'

  target '<App_Name>Tests' do
    inherit! :search_paths
    # Pods for testing
  end

  post_install do |installer|
    ## Fix for XCode 12.5 beta
    find_and_replace("../node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm",
    "_initializeModules:(NSArray<id<RCTBridgeModule>> *)modules", "_initializeModules:(NSArray<Class> *)modules")
    find_and_replace("../node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm",
    "RCTBridgeModuleNameForClass(module))", "RCTBridgeModuleNameForClass(Class(module)))")
end

  # use_native_modules!
end

target '<App_Name>-tvOS' do
  # Pods for <App_Name>-tvOS

  target '<App_Name>-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

end
def find_and_replace(dir, findstr, replacestr)
  Dir[dir].each do |name|
      text = File.read(name)
      replace = text.gsub(findstr,replacestr)
      if text != replace
          puts "Fix: "   name
          File.open(name, "w") { |file| file.puts replace }
          STDOUT.flush
      end
  end
  Dir[dir   '*/'].each(&method(:find_and_replace))
end

As you can see down there, I have:

pod 'RNFirebase', :path => '../node_modules/react-native-firebase'

If I add /ios to the end there, the pod install will work but then it can't build it in Xcode.

I tried many solutions, nothing worked for me.

I tried deintegrate Cocoapods and pod install after that.

I tried deleting node_modules folder and then install again.

Also tried deleting Pods folder as well as the Podfile and Podfile.lock and then installing them again. Nothing worked.

I use Ventura. Xcode 14.

CodePudding user response:

Check that path ../node_modules/react-native-firebase, keep in mind it's a relative path, so should start from the folder where is your Podfile file.

Also in that folder ../node_modules/react-native-firebase should be file with extension .podspec

CodePudding user response:

Please add this import in AppDelegate file

#import <Firebase.h>

  • Related