【发布时间】:2015-12-07 21:11:46
【问题描述】:
当我尝试升级到 React Native 0.16.0 版时,我无法克服这些错误。
问题在于它似乎没有在模拟器中完成“获取 js 包”(使用 Genymotion)。然后过了一会又出现红屏错误:undefined is not an object (evaluating 'require('NativeModules').UIManager.AndroidSwipeRefreshLayout.Constants')
如果我尝试 Chrome 调试,我会收到带有 Cannot read property 'Constants' of undefined 的红色错误屏幕
如果开发模式为真/已检查(不再在 Chrome 中调试),我会收到另一个错误:TypeError: expected dynamic type 'double', but had type 'boolean' (constructing arguments for RTCNetworking.sendRequest at argument index 5)
这些错误似乎来自 react-native 节点模块。我不确定如何解决这个问题,或者它是否真的很明显。
另外,我想指出,对于 v0.15.0,在 android/app/build.gradle 中,只有这个有效:compile "com.facebook.react:react-native:0.14.+"。是否需要针对 v0.16.0 进行更改?我尝试过更改它,但没有成功,除非它是一个完全不同的数字。
【问题讨论】:
标签: android react-native