react-native-video: Cannot read property 'Constants' of null
Asked Answered
T

6

7

I am trying to include a YouTube video in my react native project. Since I already tried react-native-youtube and did not work at all I tried installing react-native-video.

However, I am getting the following error: enter image description here

I tried: deleting my node_modules and npm i again followed by react-native link and react-native link react-native-video. Several times.

My package.json:

enter image description here

Theorize answered 1/2, 2020 at 15:17 Comment(2)
your source? <Video /> component parameters? .... from source ` const RCTVideoInstance = this.getViewManagerConfig('RCTVideo');` failsMcelhaney
This is happening to me on android too, any help?Coonhound
C
2

For Android using Expo and EAS Build I just ran

eas build --profile development --platform android

This fixed my issue

I assume with pure React Native too you just need to rebuild the App.

Cossack answered 2/3, 2023 at 7:52 Comment(1)
Yes Sizo in React Native with Rebuild it works! Thank youHeerlen
T
0

react-native: 0.63.4: the problem is with linking, the issue got fixed by following these steps:

  • -removing the Pods folder from the ios folder:
  • -removing the node modules
  • -removing the build using this command: rm -rf ios/build
  • -running Yarn to reinstall the packages
  • -installing Pods using this command: cd ios && pod install --repo-update && cd ..
  • -running the ios build
  • -starting react native and removing the cache with this command: yarn start --reset-cache
Tortious answered 1/3, 2021 at 11:54 Comment(0)
S
0

This worked for me

  • react-native link
  • cd ios && pod install
  • check in podfile that react-native-video is added or not.
  • If not add it manually and run pod install.
  • then in xcode build Phases check search video , if you found video package already added then run app and check.
  • otherwise add it manually in Link Binary with Libraries.
  • and run app.
Stadiometer answered 14/12, 2021 at 10:23 Comment(1)
And for android?Coonhound
F
0

for me it was closing the metro window (I switched from project with react-native-video to a project with expo-av)

Frequency answered 2/2, 2024 at 5:14 Comment(0)
D
0

For me, it was downloading packages with npm. I had installed expo-CLI and was downloading packages for react-native CLI. There's some cross package error i guess however if you're using expoCLI and missed this by mistake you can clean node_modules remove package-lock.json and use expo-video. https://docs.expo.dev/versions/latest/sdk/video/ or https://www.npmjs.com/package/expo-video-player

npm i expo-video-player

Dubious answered 26/2, 2024 at 6:59 Comment(0)
K
0

An old build was the root of my problem. Had to delete the app and reinstall with xcode. Classic rinse and repeat.

"react-native": "0.74.3", "react-native-video": "^5.2.1",

For reference: https://github.com/TheWidlarzGroup/react-native-video/issues/1738#issuecomment-533917249

Knockwurst answered 28/9, 2024 at 14:40 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.