React Native Firebase 不会安装在 iOS React Native 项目上。它在 Android 上运行良好。
我遵循了这个指示。 https://rnfirebase.io/docs/v5.x.x/installation/initial-setup 我设置了 Firebase,通过 XCode 添加了下载的 plist 文件,安装并设置了 Cocoapod。
当我将以下行添加到 App.js 时,模拟器会返回一条错误消息。
import firebase from 'react-native-firebase';
错误消息:“在 iOS 上 native 未找到 RNFirebase 核心模块”
我尝试了从这个论坛中学到的一些东西: https://github.com/invertase/react-native-firebase/issues/614
block 引用>I commented out following lines from Podfile
use_frameworks!
然后 pod install、pod update
block 引用>on Xcode, checked the Build Phases/ Link Binary with Libraries section. I checked libRNFirebase.a was already there.
我已经断断续续地尝试了几个月。我还没有找到在 iOS 项目上安装 React Native Firebase 的方法。任何指针将不胜感激。
最佳答案
我目前正在维护react-native-firebase v5分支(当前稳定),由于某种原因,我们现在的 header 搜索路径确实存在问题。
我没有明确的修复方案,但我构建了一个演示,该演示从react-native init开始,然后安装react-native-firebase,并执行所有必要的操作,以便该项目在iOS上构建和运行,甚至存档处于 Release模式。
您可以在这里看到:https://github.com/mikehardy/rnfbdemo
目前唯一重要的事情是,在遵循所有安装说明后,您需要在 Podfile 中放入一个未记录的内容,如最后 end
之前的最后一行。
system("mkdir -p Pods/Headers/Public/FirebaseCore && cp Pods/FirebaseCore/Firebase/Core/Public/* Pods/Headers/Public/FirebaseCore/")
关于ios - 错误消息 - 在 iOS 上 native 未找到 RNFirebase 核心模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56614556/