【问题标题】:react-native-video: Cannot read property 'Constants' of nullreact-native-video:无法读取 null 的属性“常量”
【发布时间】:2020-02-01 15:17:39
【问题描述】:

我正在尝试在我的 react 原生项目中包含一个 YouTube 视频。由于我已经尝试过react-native-youtube 并且根本没有工作,所以我尝试安装react-native-video

但是,我收到以下错误:

我试过了: 再次删除我的 node_modules 和 npm i,然后是 react-native 链接和 react-native 链接 react-native-video。好几次。

我的 package.json:

【问题讨论】:

  • 您的来源? <Video /> 组件参数? ....来自源`const RCTVideoInstance = this.getViewManagerConfig('RCTVideo');` 失败
  • 我在 android 上也发生了这种情况,有什么帮助吗?

标签: javascript reactjs react-native react-native-android react-native-video


【解决方案1】:

反应原生:0.63.4: 问题在于链接,通过以下步骤解决了问题:

  • -从ios文件夹中删除Pods文件夹:
  • -删除节点模块
  • -使用以下命令删除构建:rm -rf ios/build
  • -运行 Yarn 重新安装软件包
  • -使用以下命令安装 Pod:cd ios && pod install --repo-update && cd ..
  • -运行 ios 构建
  • -使用以下命令启动本机反应并删除缓存:yarn start --reset-cache

【讨论】:

    【解决方案2】:

    这对我有用

    • react-native 链接
    • cd ios && pod install
    • 在 podfile 中检查是否添加了 react-native-video。
    • 如果不手动添加并运行 pod install。
    • 然后在 xcode build Phases 检查搜索视频,如果您发现视频包已添加,则运行应用程序并检查。
    • 否则在 Link Binary with Libraries 中手动添加。
    • 并运行应用程序。

    【讨论】:

    • 安卓系统呢?
    猜你喜欢
    • 2016-11-16
    • 1970-01-01
    • 1970-01-01
    • 2016-06-10
    • 2019-03-13
    • 1970-01-01
    • 2021-10-31
    • 1970-01-01
    • 2019-11-21
    相关资源
    最近更新 更多