ios - 你如何调试 React Native iOS 中的链接错误?

标签 ios xcode react-native cocoapods

例如 RCTImageLoader 未定义:

enter image description here

它是 RN 中图像库的一部分:

enter image description here

我的 Podfile 中有这个:

在我的 Podfile 中有这一行:pod 'React', :subspecs => ['Core', 'RCTImage', 'RCTNetwork', 'RCTLinkingIOS', 'RCTText', 'RCTWebSocket'], :path => '../node_modules/react-native'

这是我的图书馆: enter image description here

我试过:

  • 项目 -> 清理
  • 再次运行pod install
  • 删除 Podfile.lock && pod install
  • 新鲜的 git 克隆,npm install && cd ios && pod install

最佳答案

您也可以尝试手动添加头文件,例如../node_modules/react-native/Libraries/Image/RCTImageLoader.h

但是在我的情况下,这没有帮助。解决方案是打开 MyProject.xcworkspace 而不是 MyProject.xcproject

关于ios - 你如何调试 React Native iOS 中的链接错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39310473/

相关文章:

android - 可怕的 libPNG 在 iOS 上的表现

java - 使用 GMImagePickerController 播放视频时黑屏

react-native - react native 构建成功,但 "No devices are booted."

google-maps - React Native,不变违规 : Native component for "AIRMap" does not exist

iphone - 使用不带 alertView 的 UIWebView 在 iOS 中以编程方式调用电话

ios - 如何将触摸事件发送到 iOS 中的 superview?

javascript - CKEditor iOS 在按钮事件上获取 HTML 编辑器内容

ios - TableView 和 PKRevealController 手势冲突 - 如何真正解决它们?

xcode - 导入包含 OPENCV 函数的静态库时为 "Undefined symbols for architecture armv7"

javascript - 如何使用 Debounce Lodash React Native 加快搜索速度