Getting red screen of death with
undefined is not an object (evaluating NativeModuels.UIManager.RCTVideo.Constants')
on Android
under react-native 0.23.1
Did you try re-running: react-native run-android or react-native run-ios? I had this same problem but this did the trick for me. I forgot to re-run this after installing react-native-video through npm install.
Fixed, I think one of the gradles had a typo. For anyone finding this bug, double check that all three files are perfect: build.gradle, settings.gradle, MainActivity.java
@braco I am getting this when react-native run-ios. This can't be a problem in any of the gradle files or the MainActivity.java, right?
I'm having the same issue, running react-native run-ios. please advise on how to fix this?
I'm having the same issue for react-native run-ios.
I am trying to run video in IOS device using react native but I found Unhandled JS Exception: undefined is not an object (evaluating 'NativeModules.UIManager.RCTVideo.Constants') error. Error screen shot here
http://screencast.com/t/xoL6C50QKDi
Same issue here. Has anyone found a solution/workaround for this problem ?
Also looking for solution, using react-native run-android.
@BranoMatan I found out the problem was with the rnpm link react-native-video not working properly.
Solution: open android/app/src/main/java/com/app_name/MainApplication.java in the top section of the file (where all the imports are) add import com.brentvatne.react.ReactVideoPackage; and then in the getPackages() method add new ReactVideoPackage(), build again and run.
Thanks @logileifs ! Worked perfectly
@logileifs where can i find the getPackages() method? i did other changes as you suggested.
@Johnny1109 if your react native version is 0.29.0 or greater you will find it in android/app/src/main/java/com/NAME_OF_YOUR_APP/MainApplication.java
If your react native version is less than 0.29.0 than you will find it in android/app/src/main/java/com/app_name/MainActivity.java
You can see your react native version in package.json in your project root directory
@logileifs thanks logileifs, i got it in MainApplication.java
protected List
return Arrays.
new MainReactPackage();
new ReactVideoPackage();
);
}
is this correct, because still i am getting error
@Johnny1109 You're almost there! Just change the semicolon after new MainReactPackage() to a comma. It should look like this:
protected List getPackages() {
return Arrays.asList(
new MainReactPackage(),
new ReactVideoPackage()
);
}
@logileifs thank you so much.. it works now
@Johnny1109 you are very welcome :)
@logileifs any idea why video not visible, i can hear the audio.. thanks in advance
@Johnny1109 I'm sorry but that's a totally unrelated problem. Most likely your view is too small so your video is not appearing or it's simply not on the screen itself. You should really ask that question somewhere else like stackoverflow
@logileifs I am getting below error after doing what you suggested
error: cannot find symbol
new ReactVideoPackage()
^
symbol: class ReactVideoPackage
2 errors
:app:compileDebugJavaWithJavac FAILED
FAILURE: Build failed with an exception.
you are great!
Just wanted to post my most recent workaround for iOS in case someone runs into this again. I blew away node_modules, reset any XCode changes to the .pbxproj related to react-native-video, then did a fresh npm install and a fresh react-native link react-native-video and it worked. I'm assuming the linking got messed up somehow and removing those attempts and starting over helped
undefined is not an object (evaluating 'CardIOUtilities.DETECTION_MODE')
No matter what i do i keep getting this error. What can i do?
@Tzinov15 Still i have the issue after following your steps. I am trying to do this in Expo. Any suggestions?
@varunrayen I'm also experiencing the issue after following @Tzinov15 steps.. Anybody have a solution?
Same issue, not working
$ react-native --version
react-native-cli: 2.0.1
react-native: 0.46.4
on my package.json
...
"dependencies": {
"expo": "^19.0.0",
"react": "16.0.0-alpha.12",
"react-native": "^0.46.1",
"react-native-awesome-card-io": "^0.6.4",
"react-native-video": "^2.0.0"
}
...
same issue on expo!
@varunrayen I opened an issue on expo, could you help me to provide a repro?
Same issue. The doc me . Before you use it , you must run rnpm link.When the link may fail,do it manually.
For Expo users, this library doesn't seem compatible with Expo, you can use this library :
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
to link library on iOS do next steps:
1)in XCode right click on "Libraries" folder and choose 'add files to prjctname'
then go to node_modules/react-native-video/ios/ and choose RCTVIdeo.xcodeproj
2) go to targets -> Build Phases ->Link Binary With Libraries hit + and choose libRCTVideo.a
3)profit
same with expo too
try to add dependencies in build.grade Module: app
dependencies {
.....
compile project(':react-native-video')
}
XCode right click on "Libraries" folder and choose 'add files to prjctname'
How to get on this option?
Run the command of react-native link and after react-native run-android.
The first command links the dependencies and after that it will work!
@Lipfroy I was hoping this would be the magical solution but it broke my build. Metro bundler should supposedly do all this linking manually so doing it in XCode is unnecessary:
error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:
- react-native-video (to unlink run: "react-native unlink react-native-video")
This is likely happening when upgrading React Native from below 0.60 to 0.60 or above. Going forward, you can unlink this dependency via "react-native unlink <dependency>" and it will be included in your app automatically. If a library isn't compatible with autolinking, disregard this message and notify the library maintainers.
Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md
Found the solution for my case, after re-unlinking the native dependency:
cd ios/
pod install
Thanks to https://github.com/react-native-community/react-native-video/issues/1502#issuecomment-480905260
Most helpful comment
@BranoMatan I found out the problem was with the
rnpm link react-native-videonot working properly.Solution: open
android/app/src/main/java/com/app_name/MainApplication.javain the top section of the file (where all the imports are) addimport com.brentvatne.react.ReactVideoPackage;and then in thegetPackages()method addnew ReactVideoPackage(), build again and run.