Git Product home page Git Product logo

Comments (13)

A-ANing avatar A-ANing commented on June 17, 2024 4

Native module cannot be null 就是依赖包没有pod成功,检查podfile.lock文件中是否有安装这5个包

  • 如果没有,删除项目中下面的包 可以手动删除 也可以npm uninstall xxxx
react-native-linear-gradient
react-native-orientation-locker
react-native-svg
react-native-system-setting
react-native-video
  • 然后复制下面的添加到自己项目的package.json中的dependencies内
"react-native-rn-videoplayer": "^2.2.9",
"react-native-linear-gradient": "^2.5.6",
"react-native-orientation-locker": "^1.1.8",
"react-native-svg": "^9.5.1",
"react-native-system-setting": "^1.7.2",
"react-native-video": "^5.0.2"
  • 然后执行
npm i

cd ios

pod install

from react-native-rn-videoplayer.

zscm avatar zscm commented on June 17, 2024 1

node_modules/react-native-rn-videoplayer/ 下没有ios目录,我感觉这个有问题

将react-native-rn-videoplayer/package.json中的所用的几个插件拷贝到你自己的工程package.json,删除node_module,重新npm install,就可以了,安卓如果在application手动添加了package,注释掉就可以了,我测试了可以用

from react-native-rn-videoplayer.

iCodeAnt avatar iCodeAnt commented on June 17, 2024

import VideoPlayer from 'react-native-rn-videoplayer';

这样导入后会报错0.63的react-native

from react-native-rn-videoplayer.

qilovehua avatar qilovehua commented on June 17, 2024

#2
我的解决#2后也报这个错,"react-native": "0.61.5"
说是要remove几个包,react-native-linear-gradient,react-native-orientation-locker,react-native-system-setting这3个在yarn.lock里有,package.json里面,没法remove。
@A-ANing

from react-native-rn-videoplayer.

qilovehua avatar qilovehua commented on June 17, 2024

Invariant Violation: Native module cannot be null.

constructor
NativeEventEmitter.js:36:6

SystemSetting.js:11:21
loadModuleImplementation
require.js:321:4
guardedLoadModule
require.js:210:11
metroRequire
require.js:128:6

index.js:38
loadModuleImplementation
require.js:321:4
guardedLoadModule
require.js:210:11
metroRequire
require.js:128:6

from react-native-rn-videoplayer.

A-ANing avatar A-ANing commented on June 17, 2024

android 手动link一下
ios 需要pod install

from react-native-rn-videoplayer.

iCodeAnt avatar iCodeAnt commented on June 17, 2024

android 手动link一下
ios 需要pod install

感谢回复,有做pod install 还是报错,方便提供个小demo吗!

from react-native-rn-videoplayer.

motogod avatar motogod commented on June 17, 2024

android 手动link一下
ios 需要pod install

pod install 沒有安裝到 library

from react-native-rn-videoplayer.

zscm avatar zscm commented on June 17, 2024

大佬,"react-native": "0.62.2" 安卓正常,IOS报错,Invariant Violation: Native module cannot be null.,进入ios/下 pod install,还是提示这个Invariant Violation: Native module cannot be null.,有ios的简单的demo可以让看看吗?万分感谢

from react-native-rn-videoplayer.

qilovehua avatar qilovehua commented on June 17, 2024

node_modules/react-native-rn-videoplayer/ 下没有ios目录,我感觉这个有问题

from react-native-rn-videoplayer.

zscm avatar zscm commented on June 17, 2024

我初始化一个新工程就安装了这一个插件,也是报的nvariant Violation: Native module cannot be null.这个错,等作者大佬不忙的时候看看怎么回复

from react-native-rn-videoplayer.

A-ANing avatar A-ANing commented on June 17, 2024

over

from react-native-rn-videoplayer.

qew4 avatar qew4 commented on June 17, 2024

33% 卡在这里8分钟,dependencies of :react-native-rn-videoplayer:classpath

from react-native-rn-videoplayer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.