React-native-youtube: "'WKYTPlayerView.h' file not found" during installation (after manual link)

Created on 13 Sep 2019  路  18Comments  路  Source: davidohayon669/react-native-youtube

I've tried and retried this many times, same error. Currently the steps I've taken:

  1. `npm install react-native-youtube -S
  2. Project in Xcode -> Libraries -> Add Files -> node_modules/react-native-youtube/RCTYouTube.xcodeproj
  3. Then the main project -> Build Phases -> Link Binary With Libraries +libRCTYouTube
  4. npm run ios

Then I receive:
`/Users/danfein/Desktop/reviews/native/node_modules/react-native-youtube/RCTYouTube.h:1:9: fatal error: 'WKYTPlayerView.h' file not found

import "WKYTPlayerView.h"

    ^~~~~~~~~~~~~~~~~~`

Any idea what this may be caused by?

Most helpful comment

For anyone with this issue. I forked the repo and was able to link the library without cocoapods in RN 0.59 just change in your package.json this:
"react-native-youtube": "eleddie/react-native-youtube#bdf7bce",
Then link and it works fine.

All 18 comments

@danielfein iOS version from 2.0.0-beta.2 uses another Cocoapod dependency (https://github.com/hmhv/YoutubePlayer-in-WKWebView) linked in the podspec. I'm not sure how you can manually link that library, but with Cocoapods it should work seamlessly

Im trying to avoid cocoapods and do all my linking for ios manually (i've found it less troublesome) so it would be good to know what we can do here. I've kept my version at v1 as well, but as we are seeing ios rejections for the UI Web view usage in this package, it seems v2 may have to be used so this is a bit of a blocker.

@ironworkshop I'm pretty sure this pod can be manually linked. You can check in their repo

1) Add this line to Podfile
pod 'YoutubePlayer-in-WKWebView', :git => 'https://github.com/hmhv/YoutubePlayer-in-WKWebView'
2) Run pod install

So luck so far. t I see https://github.com/inProgress-team/react-native-youtube/issues/391. Seems it's occurring more and more. :/

Why is this closed?

This never should have been closed....

@danielfein Why not? The supported way to link that dependency is with Cocoapods, there might be other ways to do it through XCode but this is not a problem with this library

Cannot link manually, getting _WKYTPlayerView.h' file not found_ can this issue be open again?

Updating to RN 60 was the only fix, the maintainers of this project are absolutely not helpful lol.

@danielfein There is only one maintainer, and he has a full-time job. There must be unlimited information online on how to link iOS libraries without Cocoapods. this is not a specific issue in this library

Also: you are more than welcomed to help maintain this lib

'WKYTPlayerView.h' file not found in RCTyoutube.h

error on line no 1 #import "WKYTPlayerView.h"

im using with react native 59.10 version.

Updating to RN 60 was the only fix, the maintainers of this project are absolutely not helpful lol.

@danielfein I Absolutely agree haha, It's giving us issues even after upgrading to RN60.0 what is the specific version of RN x.xx.xx that's working for you?

@kgirma @danielfein for limited resources I can only maintain RN 60 and up support

For anyone with this issue. I forked the repo and was able to link the library without cocoapods in RN 0.59 just change in your package.json this:
"react-native-youtube": "eleddie/react-native-youtube#bdf7bce",
Then link and it works fine.

Still getting this issue using RN 0.59.10 trying to manually link library

A solution for manual link in RN 0.60+

  1. Download YoutubePlayer-in-WKWebView zip file
  2. Extract zip file in the iOS folder of your project
  3. Import the youtube-ios-player-helper.xcodeproj in your Xcode project
  4. In YourProjectName.xcodeproj go to Build Phases > Link Binary With Libraries and add YouTubeiOSPlayerHelp.framework
  5. In YourProjectName.xcodeproj go to General > Frameworks, Libraries, and Embedded Content and set Embed & Sign to YouTubeiOSPlayerHelp.framework
  6. In RCTYouTube.xcodeproj go to Build Settings > Search Paths > Header Search Paths and add non-recursive $(SRCROOT)/../../ios/YoutubePlayer-in-WKWebView/WKYTPlayerView
  7. In Xcode go to Product > Clean and finally Product > Build
Was this page helpful?
0 / 5 - 0 ratings

Related issues

RetroPronghorn picture RetroPronghorn  路  3Comments

nhcuong95 picture nhcuong95  路  5Comments

manjeet-dobble picture manjeet-dobble  路  5Comments

johnnykoo84 picture johnnykoo84  路  4Comments

matthiasleitner picture matthiasleitner  路  5Comments