react-native-video error

react-native-video error

Users/holoto/WebstormProjects/demo/android/app/src/main/java/com/demo/MainActivity.java:4: error: cannot find symbol
import com.brentvatne.RCTVideo.ReactVideoPackage;
                              ^
  symbol:   class ReactVideoPackage
  location: package com.brentvatne.RCTVideo
/Users/holoto/WebstormProjects/demo/android/app/src/main/java/com/demo/MainActivity.java:46: error: cannot find symbol
            new ReactVideoPackage(),^
  symbol:   class ReactVideoPackage
  location: class MainActivity
2 errors
:app:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1 mins 17.722 secs
Could not install the app on the device,read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html

code

Check “`
android/app/src/main/java/com/{你的rn项目名称}/MainActivity.java

 

import com.brentvatne.RCTVideo.ReactVideoPackage;

to

import com.brentvatne.react.ReactVideoPackage;
“`

参考

https://github.com/brentvatne/react-native-video/issues/217

相关文章

react 中的高阶组件主要是对于 hooks 之前的类组件来说的,如...
我们上一节了解了组件的更新机制,但是只是停留在表层上,例...
我们上一节了解了 react 的虚拟 dom 的格式,如何把虚拟 dom...
react 本身提供了克隆组件的方法,但是平时开发中可能很少使...
mobx 是一个简单可扩展的状态管理库,中文官网链接。小编在接...
我们在平常的开发中不可避免的会有很多列表渲染逻辑,在 pc ...