A-ANing / react-native-rn-videoplayer

基于react-native-video的视频播放器(上下滑动改变音量屏幕亮度,缓冲进度,双击暂停等ios Android)
95 stars 40 forks source link

IOS 报错 Invariant Violation: Native module cannot be null. #24

Open lyichao opened 3 years ago

lyichao commented 3 years ago

rn版本:0.61.5 集成到IOS成功了,但加上 import VideoPlayer from 'react-native-rn-videoplayer';时就会报错Native module cannot be null. 请问这个问题有解决办法吗?

lyichao commented 3 years ago

有demo可以运行吗?

A-ANing commented 3 years ago

依赖没安装成功,请检查pod成功没;你可以在Podfile文件中添加

pod 'react-native-orientation-locker', :podspec => '../node_modules/react-native-orientation-locker/react-native-orientation-locker.podspec'
  pod 'RNSVG', :podspec => '../node_modules/react-native-svg/RNSVG.podspec'
  pod 'BVLinearGradient', :podspec => '../node_modules/react-native-linear-gradient/BVLinearGradient.podspec'
  pod 'RCTSystemSetting', :path => '../node_modules/react-native-system-setting'

然后

pod install
A-ANing commented 3 years ago

也许还需要

pod 'react-native-video', :path =>  "../node_modules/react-native-video"
lyichao commented 3 years ago

依赖没安装成功,请检查pod成功没;你可以在Podfile文件中添加

pod 'react-native-orientation-locker', :podspec => '../node_modules/react-native-orientation-locker/react-native-orientation-locker.podspec'
  pod 'RNSVG', :podspec => '../node_modules/react-native-svg/RNSVG.podspec'
  pod 'BVLinearGradient', :podspec => '../node_modules/react-native-linear-gradient/BVLinearGradient.podspec'
  pod 'RCTSystemSetting', :path => '../node_modules/react-native-system-setting'

然后

pod install

按你的步骤添加后已经解决问题了,谢谢。建议README上是也加上ios手动link步骤