react-native - 错误 : RNFirebase core module was not found natively on iOS

标签 react-native cocoapods react-native-firebase

我创建了一个新应用程序并尝试使用 react-native-firebase .但我不断收到此错误:

RNFirebase core module was not found natively on iOS, ensure you have correctly included the RNFirebase pod in your projects 'Podfile' and have run 'pod install'.

See http://invertase.link/ios for the ios setup guide.



我已经完成的步骤:
  • yarn add react-native-firebase
  • react-native link react-native-firebase
  • 在 .../myproject/ios/myproject
  • 下从 Google 设置我的 .plist 文件
  • pod update在确保我使用的是 Ruby 2.5.0
  • 之后
  • 运行 pod install

  • 我目前使用的 pod 文件是:
    # Uncomment the next line to define a global platform for your project
    platform :ios, '9.0'
    
    target 'MyProject' do
      # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
      # use_frameworks!
        pod 'Firebase/Core'
        pod 'Firebase/Database'
        pod 'Firebase/Messaging'
    
      target 'MyProjectTests' do
        inherit! :search_paths
        # Pods for testing
      end
    
    end
    

    这些是我正在使用的版本:
    "react": "^16.3.0-alpha.1",
    "react-native": "0.54.2",
    "react-native-firebase": "^3.3.1",
    

    最佳答案

    如果不想手动链接,可以尝试直接将 RNFirebase 安装为 pod install:

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

    更改或硬编码 HEADER_SEARCH_PATHS没有帮助我。当错误再次发生时,没有必要 rm -rf node_modules也不删除 pod 文件等,我发现清除缓存很有用。

    关于react-native - 错误 : RNFirebase core module was not found natively on iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49427871/

    相关文章:

    reactjs - 从 MobX 操作返回 promise

    javascript - 从 AsyncStorage 读取、解析数组、将字符串转换为日期对象

    ios - CocoaPods Google Analytics .xcworkspace和.xcodeproj文件

    ios - 如何在我的设备上而不是在 iPhone 6 模拟器中运行我的 React Native 应用程序?

    firebase react native : convert anonymous user to a permanent user via phone auth

    android - 在 React Native 0.59 上将目标 sdk 升级到 29

    javascript - 在 React Native 中创建一个 Theme Provider 组件

    javascript - React Native 点燃错误 : uncaught at root at takeLatest at saga

    iOS 编译库/框架链接器标记为设备而非模拟器编译的问题

    ios - 编辑 Xcode xcconfig 文件和 Cocoapods