react-native-video: Cannot read property 'Constants' of undefined
I know this is a duplicate issue, but none of the other solutions have worked for me.
...
"react": "15.3.1",
"react-native": "^0.35.0",
"react-native-video": "^1.0.0",
...
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 5
- Comments: 18 (6 by maintainers)
@johnchourajr Nevermind, run
react-native run-iosto reinstall the application after linking withreact-native link.ios 1、先按照这个组件的说明,修改APPDelegate.m。如果还不行。 2、打开xcode。查看Libraries里面有没有RCTVideo.xcodeproj.。如果没有,添加它。这个文件在你的项目node_modules/react-native-video文件夹中 3、build Phases----Link Binary with Libraries中添加libRCTVideo.a 4、编译运行。
我的问题就是这样解决的
Leave all and Simply Go Native and Do it Like this!
1).
expo install expo-av2). Your
App.jsshould beimport React from ‘react’; import { StyleSheet, Text, View } from ‘react-native’;
import { Video } from ‘expo-av’;
export default class App extends React.Component { render(){ return ( <View style={styles.container}> <Text>Open up App.js to start working on your app!</Text>
} }
const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: ‘#fff’, alignItems: ‘center’, justifyContent: ‘center’, }, });
3).
expo startWhen using CocoaPods, one might have to link it manually in the podfile: