davidohayon669/react-native-youtube

Invariant Violation: requireNativeComponent: "RCTYouTube" was not found in the UIManager.

Opened this issue · 2 comments

here is the detail:-
I generated my react native expo project using the command line npx expo-cli init youtube
then I refered to this link:- https://www.npmjs.com/package/react-native-youtube

I installed the react-native-youtube dependencies using the command:- npm i react-native-youtube
I also got my official youtube API from https://developers.google.com/youtube/android/player/register

In App.js file the below are the codes written



`import React from 'react'
import {View,StyleSheet,Text,SafeAreaView} from 'react-native'
import YouTube from 'react-native-youtube';

`const App=()=>{


  const linkTest="https://www.youtube.com/watch?v=aqz-KE-bpKQ"

    return (


      <SafeAreaView style={styles.container}>

      <YouTube
      apiKey="*******************"
      videoId={linkTest} // The YouTube video ID
      play // control playback of video with true/false
      fullscreen // control whether the video should play in fullscreen or inline
      loop // control whether the video should loop when ended
      onReady={e => this.setState({ isReady: true })}
      onChangeState={e => this.setState({ status: e.state })}
      onChangeQuality={e => this.setState({ quality: e.quality })}
      onError={e => this.setState({ error: e.error })}
      style={{ alignSelf: 'stretch', height: 300 }}
    />  


        </SafeAreaView>


         )
}


const styles= StyleSheet.create({
    container:{ backgroundColor:"white", flex:1},



})
export default App
`

After this, in my cmd I ran :- npm start
Scanned the QRCode and opened the App in my EXPO App in my mobile
the following is the screenshot on Iphone of the error I got i.e
The below picture are screenshots of project running on expo on IOS platform or iphone

WhatsApp Image 2020-09-30 at 7 29 36 PM (1)
WhatsApp Image 2020-09-30 at 7 29 37 PM
WhatsApp Image 2020-09-30 at 7 29 36 PM

And The below picture are screenshots of project running on expo on android platform or mobile
WhatsApp Image 2020-09-30 at 7 40 39 PM

#259

Same problem here. Any update on this?

I have installed the lib running expo install react-native-youtube

I tried various ways as discussed in #259 to no avail, in the end, I decided to eject (expo eject) and finally it worked.
Have to forgo expo's managed workflow but no choice until this is supported by expo.