【问题标题】:Invariant Violation: Native component for "RCTImageView" does not exist不变违规:“RCTImageView”的本机组件不存在
【发布时间】:2018-05-25 08:06:44
【问题描述】:

我在 Xcode 中使用一个“主”页面创建了本机项目,我希望在 React Native 中完成该项目的其余部分。一切都很顺利,直到我尝试在 JSX 中使用 <Image> 标签。我试图找到解决方案,但没有效果。

如果我完全在 React Native 中创建项目(没有 Xcode 中的现有部分)<Image> 标签可以完美运行。

【问题讨论】:

标签: ios node.js xcode react-native


【解决方案1】:

我发现问题出在哪里。 我没有在我的 Podfile 中添加“RCTImage”

    pod 'React', :path => './node_modules/react-native', :subspecs => [
    'Core',
    'CxxBridge', 
    'DevSupport',
    'RCTText',
    'RCTNetwork',
    'RCTWebSocket',
    'RCTImage', // <- this component was missing
  ]

【讨论】:

  • 如果我不使用 pod?有什么解决办法吗,谢谢
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-05-06
  • 2022-08-19
  • 1970-01-01
  • 2016-01-30
  • 1970-01-01
相关资源
最近更新 更多