首页 > 解决方案 > 无法在 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

不确定这部分是否与同一问题有关并且可以帮助调试它。

标签: react-nativenpmyoutube

解决方案


推荐阅读