未定义不是对象(评估 StatusBarManager.HEIGHT) react-native 0.55.4 [英] Undefined is not an object (evaluating StatusBarManager.HEIGHT) react-native 0.55.4

查看:27
本文介绍了未定义不是对象(评估 StatusBarManager.HEIGHT) react-native 0.55.4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚升级到 react-native 0.55.4.在 iOS 上成功启动并运行后,我现在在 Android 上启动并运行它.我收到以下错误:

I've just upgraded to react-native 0.55.4. After successfully getting it up and running on iOS, I'm now getting it up and running on Android. I'm getting the following error:

Undefined is not an object (evaluating StatusBarManager.HEIGHT) 

我跟踪 StatusBarManager.HEIGHTnode_modules/react-native/Libraries/Components/StatusBar/StatusBar.js.这是我整个代码库中唯一可以访问 StatusBarManager.HEIGHT 的位置它在 react-native 包本身中.任何想法为什么会发生这种情况?我到处寻找解决方案.

I tracked StatusBarManager.HEIGHT down to node_modules/react-native/Libraries/Components/StatusBar/StatusBar.js. This is the only location in my entire codebase where StatusBarManager.HEIGHT is being accessed & it's in the react-native package itself. Any ideas why this is happening? I've searched everywhere for a solution.

出于某种原因,当我将模拟器连接到 react devtools 时出现了不同的错误:

For some reason I get a different error when I connect my emulator to the react devtools:

推荐答案

就我而言,问题是我错过了 MainApplication.java

In my case the problem is that I missed a package inside MainApplication.java

包是 new MainReactPackage()getPackages() 方法中.

The package is new MainReactPackage() inside getPackages() method.

这篇关于未定义不是对象(评估 StatusBarManager.HEIGHT) react-native 0.55.4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆