react-native-youtube icon indicating copy to clipboard operation
react-native-youtube copied to clipboard

iOS Install Guide | React Native 60.5

Open jordangrant opened this issue 4 years ago • 6 comments

This is the only procedure that worked for me when installing this library. It solves:

  • Invariant Violation: requireNativeComponent:"ReactYoutube" was not found in UIManager
  • Blank white thumbnail, video wont play
  • Archiving build error
  • Random build errors on iOS

If the readme isn't working for you, give this a try...

Procedure

  1. npm install react-native-youtube --save

  2. In Xcode, add RCTYouTube.xcodeproj to Libraries

  3. Build Phases > Link Binary With Libraries > add libRCTYouTube.a

  4. Click on the RCTYouTube Library, mark the Pods header search path as recursive Screen Shot 2019-10-06 at 4 22 31 PM

  5. Open your Podfile, add pod "YoutubePlayer-in-WKWebView", "~> 0.3.3" or whatever the latest version is of https://github.com/hmhv/YoutubePlayer-in-WKWebView then run:

cd ios
pod update
  1. After running pod update, make sure in Xcode, Pods > Pods folder > YoutubePlayer-in-WKWebView is there and in Products libYoutubePlayer-in-WKWebView.a is there also. Screen Shot 2019-10-05 at 7 28 23 PM
  • 7.1 If it doesn’t show in Xcode after pod update close Xcode, delete the Pods folder and podfile.lock and do pod update again.

Now click Run in Xcode. It’ll use the manually linked RCTYouTube library coupled with the WKWebView dependency as a pod.

Time to solve: 2 days

jordangrant avatar Oct 05 '19 23:10 jordangrant