razorRun / react-native-vlc-media-player

React native media player for video streaming and playing. Supports RTSP, RTMP and other protocols supported by VLC player
https://roshan.digital/
MIT License
353 stars 183 forks source link

[Error]"RCTVLCPlayer" was not found in the UIManager. #133

Closed inmess closed 1 year ago

inmess commented 1 year ago

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

截屏2022-11-24 09 35 19 截屏2022-11-24 09 39 22

The code is a simple react native test project without any other module added.

import { StyleSheet, Text, View } from 'react-native';
import { VLCPlayer } from 'react-native-vlc-media-player';

export default function App() {
  return (
    <View style={styles.container}>
      <Text>Blank App</Text>
      <VLCPlayer 
        videoAspectRatio="16:9"
        source={{ uri: "https://www.radiantmediaplayer.com/media/big-buck-bunny-360p.mp4"}} />

    </View>
  );
}

This error occurred both on iOS and Android, with exact the same error message, which I suspect this error appear where react native calling native apis.

It is quite difficult for me to locate and solve the problem once the problem is associated with native code -- I don't really have any experience on native programming.

inmess commented 1 year ago

This issue is solved. if a newer version of React Native is used in your project and met this problem, you probably need to firstly prebuild the project to get /ios and /android directories in your project. In this situation, I suppose npx expo run:[ios|android] is needed, cuz I never succeeded with yarn start.