You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

React Native iOS集成Firebase时Pod安装OTHER_LDFLAGS覆盖问题求助

Fixing React Native Firebase Integration Issues (RN 0.58.5 + RN Firebase 5.2.2)

Hey there, let's work through this Firebase integration problem together. The core issue here is that your current Podfile isn't including the necessary React Native and Firebase dependencies—let's fix that step by step:

1. Update Your Podfile with Required Dependencies

Your existing Podfile only sets up targets but doesn't pull in React Native's core pods or React Native Firebase. Replace your Podfile with this updated version:

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'

target 'movit_driver' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # React Native core dependencies
  pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'Core',
    'CxxBridge',
    'DevSupport', # Keep this for in-app dev menu access
    'RCTText',
    'RCTNetwork',
    'RCTWebSocket' # Required for debugging
  ]
  # Explicitly include Yoga (required for RN 0.42+)
  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

  # Third-party dependencies needed by React Native
  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'

  # React Native Firebase v5.2.2 pods
  pod 'Firebase/Core'
  pod 'RNFBApp', :path => '../node_modules/react-native-firebase/ios'
  # Add any additional Firebase modules you need here, e.g.:
  # pod 'Firebase/Auth'
  # pod 'RNFBAuth', :path => '../node_modules/react-native-firebase/ios'

  target 'movit_driverTests' do
    inherit! :search_paths
    # Pods for testing
  end
end

# Optional: Remove the tvOS target if you aren't building for tvOS to clean things up
# target 'movit_driver-tvOS' do
#   # use_frameworks!
#   target 'movit_driver-tvOSTests' do
#     inherit! :search_paths
#   end
# end

2. Clean Up Old Pods & Caches

Before reinstalling, let's wipe old artifacts to avoid conflicts:

  • Delete existing Pods and lock file:
    rm -rf Podfile.lock Pods
    
  • Clear CocoaPods cache:
    pod cache clean --all
    
  • Clear React Native and Xcode caches for good measure:
    watchman watch-del-all && rm -rf node_modules && npm install && rm -rf ios/build && rm -rf ~/Library/Developer/Xcode/DerivedData
    

3. Reinstall Pods

Navigate to your ios directory and run:

pod install --repo-update

The --repo-update flag ensures CocoaPods pulls the latest version of all pod specs.

4. Double-Check Build Settings

Even though you added $(inherited) before, let's confirm it's correctly set:

  1. Open your project in Xcode using the .xcworkspace file (not the .xcodeproj—this is crucial!)
  2. Select your movit_driver target
  3. Go to Build Settings and search for Other Linker Flags
  4. Ensure $(inherited) is present in both the Debug and Release configurations
  5. Also check Header Search Paths to make sure $(inherited) is included here too

5. Test the App

Now rebuild your project in Xcode. If everything went right, the pod install errors should be gone, and your app should run without Firebase-related exceptions.

内容的提问来源于stack exchange,提问作者Tanmoy Sarker

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.12 04:02:39