React Native iOS 如何调试链接错误?

3
例如,RCTImageLoader 未定义:

enter image description here

这是RN中的Image库的一部分:

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
2个回答

0
确保.m文件已经编译(->构建阶段->编译源代码)

0

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

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


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接