Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lyichao opened this issue Jan 19, 2021 · 4 comments
Open

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

lyichao opened this issue Jan 19, 2021 · 4 comments

Comments

@lyichao
Copy link

lyichao commented Jan 19, 2021

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

@lyichao
Copy link
Author

lyichao commented Jan 20, 2021

有demo可以运行吗?

@A-ANing
Copy link
Owner

A-ANing commented Jan 20, 2021

依赖没安装成功,请检查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
Copy link
Owner

A-ANing commented Jan 20, 2021

也许还需要

pod 'react-native-video', :path =>  "../node_modules/react-native-video"

@lyichao
Copy link
Author

lyichao commented Jan 21, 2021

依赖没安装成功,请检查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步骤

@lyichao lyichao closed this as completed Jan 21, 2021
@lyichao lyichao reopened this Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants