A-ANing / react-native-rn-videoplayer

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

'Orientation.h' file not found #2

Closed zinete closed 4 years ago

zinete commented 4 years ago

react-native": "0.62.2无法链接这个库,直接报错找不到

A-ANing commented 4 years ago

ios吗?

pod 添加 pod 'react-native-orientation-locker', :podspec => '../node_modules/react-native-orientation-locker/react-native-orientation-locker.podspec'

然后 pod install 试试

zinete commented 4 years ago

ios吗?

pod添加pod'react-native-orientation-locker',:podspec =>'../node_modules/react-native-orientation-locker/react-native-orientation-locker.podspec'

然后pod install试试 非常感谢,现在可以编译通过了。但是导入这个包就报 Native module cannot be null. 这个是因为原生库没链接上吗?

A-ANing commented 4 years ago

react-native-linear-gradient react-native-svg react-native-system-setting react-native-video

你的项目之前是不是安装了这四个其中之一,是的话应该是版本冲突

zinete commented 4 years ago

之前安装过,但是现在已经卸载了

A-ANing commented 4 years ago

试试

npm uninstall react-native-linear-gradient npm uninstall react-native-orientation-locker npm uninstall react-native-svg npm uninstall react-native-system-setting npm uninstall react-native-video

npm uninstall react-native-rn-videoplayer

重新安装 npm install react-native-rn-videoplayer --save 我也是0.62.2 没有问题的

zinete commented 4 years ago

还是不行,我是用yarn 安装的。我看这个项目里面没有iOS的目录,和这个有关系么?

zinete commented 4 years ago

Error: Requiring module "node_modules/react-native-rn-videoplayer/index.js", which threw an exception: Invariant Violation: Native module cannot be null.

loadModuleImplementation require.js:269:26

Video.js:11 loadModuleImplementation require.js:321:11 guardedLoadModule require.js:201:44 runUpdatedModule require.js:705:16 metroHotUpdateModule require.js:539:39 define require.js:53:8 global code Video.bundle?platform=ios&dev=true&minify=false&modulesOnly=true&runModule=false&shallow=true:1:3 [native code]:0 inject HMRClient.js:78:4 forEach [native code]:0 injectUpdate HMRClient.js:87:2 on$argument_1 HMRClient.js:155:20 emit index.js:202:16 _ws.onmessage HMRClient.js:134:10 EventTarget.prototype.dispatchEvent event-target-shim.js:818:20 _eventEmitter.addListener$argument_1 WebSocket.js:232:8 emit EventEmitter.js:189:10 __callFunction MessageQueue.js:425:19 __guard$argument_0 MessageQueue.js:112:6 __guard MessageQueue.js:373:10 callFunctionReturnFlushedQueue MessageQueue.js:111:4 callFunctionReturnFlushedQueue [native code]:0