react-native - 无法在 Ubuntu + Android 上运行 react-native-youtube
问题描述
我试图让 davidohayon669 的 react-native-youtube 在我的 Ubuntu + Android 上本地运行。我在我的 react native 应用程序中使用以下命令安装了它:
npm install react-native-youtube -S
不幸的是,我在启动应用程序时收到以下错误消息。
Invariant Violation: Invariant Violation: requireNativeComponent: "ReactYouTube" was not found in the UIManager.
我不太确定这是什么原因,并且很难调试它,因为我对本机反应还很陌生。任何帮助如何更好地调试它也非常感谢。
为了调试这个,我尝试安装 react-native-youtube 示例应用程序,但在安装 pod 时遇到问题。这对我来说似乎很奇怪,因为我正在运行 Ubuntu 18.04.4,据我所知,pod 是 OSX 的东西。
> ReactNativeYouTubeExample@2.0.1 postinstall /home/ml/p/deleteit/react-native-youtube/example
> cd ios && pod install && cd ..
Traceback (most recent call last):
2: from /usr/local/bin/pod:23:in `<main>'
1: from /usr/lib/ruby/2.5.0/rubygems.rb:308:in `activate_bin_path'
/usr/lib/ruby/2.5.0/rubygems.rb:289:in `find_spec_for_exe': can't find gem cocoapods (>= 0.a) with executable pod (Gem::GemNotFoundException)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ReactNativeYouTubeExample@2.0.1 postinstall: `cd ios && pod install && cd ..`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ReactNativeYouTubeExample@2.0.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/user/.npm/_logs/2020-07-05T08_46_58_220Z-debug.log
不确定这部分是否与同一问题有关并且可以帮助调试它。
解决方案
推荐阅读
- sas - 在sas proc sql中分组后删除列的第一个实例
- node.js - 未能在 15000 毫秒内连接到 mydb.database.windows.net:1433(Microsoft Azure SQL 数据库)
- html - flex wrap 是否与其他元素重叠?
- javascript - Navigator Geolocation showError 未在 chrome 上触发错误
- python - 如何对我在 python 中选择的范围值求和
- windows - 安装 LESS 时出现问题 - npm ERR!代码 EPERM
- python - 使用 Python 和正确的字符集从 Google 下载工作表
- c++ - 文件中首次引用的未定义符号 - Scons build
- web - 无法将 webhook 设置为 viber bot
- java - JavaFx:在构建时定义操作系统