React-native-video: [iOS] undefined is not an object (evaluating NativeModuels.UIManager.RCTVideo.Constants')

Created on 3 Jun 2016  ·  31Comments  ·  Source: react-native-video/react-native-video

Getting this error when I navigate to a scene containing the Video component under ios.
However, this only happens when I started the simulator with react-native run-ios. If I run with Xcode, everything works fine.

react native version: [email protected]

2016-06-03 1 51 49

Most helpful comment

You can do it yourself
1.in the project navigator, right click Libraries, add RCTVideo.xcodeproj to your project
2.select your project,select Build Phases -> Link Binary With Libraries,add libRCTVideo.a

  1. re-launching "react-native run-ios"

All 31 comments

I'm having the same problem.

I have same too

happens to me only when content is bundled

Same error but building from Xcode doesn't help.

Facing the same problem on android

Has anyone been able to solve this?

Same issue here on Android
Using react-native 0.23.1

Same issue react-native 0.29 on iOs

EDIT:
resolved re-launching "rnpm link react-native-video" command...

im getting this same error on Android, anyone have any luck?

re-launching "rnpm link react-native-video" didnt help

same issue

thanks everyone, this command worked: resolved re-launching "rnpm link react-native-video" command.. i was having the same issue. you just saved me another few hours of banging my head against the wall

You can do it yourself
1.in the project navigator, right click Libraries, add RCTVideo.xcodeproj to your project
2.select your project,select Build Phases -> Link Binary With Libraries,add libRCTVideo.a

  1. re-launching "react-native run-ios"

This issue has not been resolved. Why is it closed?

@nikhildaga sorry, others had commented that running 'rnpm link react-native-video' fixed the issue (or otherwise linking manually. Have you done this and are still having issues?

Still having this issue. Also rnpm or manually linking didn't work for me.
React-Native: 0.29.2
Android: 6.0.2
@mattapperson can you please re-open this issue. thx

Please try deleting the node_modules directory, 'npm cache clear' and 'npm install'. Once that is done run 'rnpm link react-native-video'

Hi @mattapperson,
could fix this issue by going into the /android folder and use

gradlew.bat clean

Keep in mind to not run the packager and delete the old imports of the Video Component at the MainActivity.java if you are using >= 0.29 RN

I'm also facing this issue. Removed node_modules, cleaned cache, ran rnpm link react-native-video, checked that libRCTVideo.a is linked in build phase and still nothing. I've also ran cd ios && xcodebuild clean, didn't help.

react-native-cli: 1.0.0
react-native: 0.32.0
node: 6.0.0
npm: 3.8.6

Update:
I had to run project from Xcode and enable developer mode...

rnpm link react-native-video will help

and then rebuild from xcode

I am currently facing this issue on Android, its working fine on iOS. I am new to React, any info would be helpful

select your project,select Build Phases -> Link Binary With Libraries,add libRCTVideo.a

For Android, this should work: https://github.com/react-native-community/react-native-video/issues/184#issuecomment-244913381

For iOS, close the packager, and then rerun the Xcode project.

I'm also facing this issue and has not been resolved. Has anyone been able to solve this?

I am also facing this problem,and it still has not been resolved,has anybody can help me solve this issue?

  • rm rf node_modules
  • yarn cache clean
  • yarn install
  • react-native link react-native-video (already linked)
  • yarn start
  • react-native run-android

I get following screen:
sdafsdafsadf

Thank you for your help.

at first i failed but at last i success android我认为ios比android好集成这个

I solved it by installing react-native-video with pods :
1) install pods
2) add this to your podfile is ios folder of your project :
pod 'react-native-video', path: '../node_modules/react-native-video'
3) launch pod install
4) maybe delete the "-obj" in the "target support files" of file "pods". You can find it by opening your xcworkspace file in xcode.
5) rerun your project

Removing derived data and restarting simulator fixed this issue for me (ios).

For me the following worked for me:

  • yarn add react-native-video - OR - npm install --save react-native-video
  • then link manually: Open Project in XCode -> right click Libraries -> Add Files to 'ProjectName' -> find RCTVideo.xcodeproj in node_modules
  • include both libRCTVideo.a in the Build Phases of the Project (you can get there under the Targets)
    (libRCTVideo.a : one is within RCTVideo.xcodeproj,the other in RCTVideo.xcodeproj > Products)
  • DO NOT include pod 'react-native-video', :path => '../node_modules/react-native-video/react-native-video.podspec' in the pod file.

You can do it yourself
1.in the project navigator, right click Libraries, add RCTVideo.xcodeproj to your project
2.select your project,select Build Phases -> Link Binary With Libraries,add libRCTVideo.a

  1. re-launching "react-native run-ios"

You can do it yourself
1.in the project navigator, right click Libraries, add RCTVideo.xcodeproj to your project
2.select your project,select Build Phases -> Link Binary With Libraries,add libRCTVideo.a

  1. re-launching "react-native run-ios"

successfully solve.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ervishu83 picture ervishu83  ·  26Comments

shlokamin picture shlokamin  ·  22Comments

jonathangreco picture jonathangreco  ·  56Comments

foxempire picture foxempire  ·  30Comments

kkesley picture kkesley  ·  27Comments