我最近升级到RN 0.20,现在尝试加载我的应用程序时抛出以下异常:
undefined is not an object (evaluating 'screenPhyisicalPixels.width')
<unknown>
index.android.bundle?platform=android& def=true:32950
requireImpl
index.android.bundle?platform=android& def=true:76
_require
index.android.bundle?platform=android& def=true:36
显然导致以下文件的JS错误:
node_modules/react-native/Libraries/Utilities/Dimensions.js at line 30
有关信息,我没有在我的应用程序中使用Dimensions API。
有什么提示吗?
我不清楚是什么命令确切地执行了什么操作,但是由于结合了@ mr-brown和@ matija-grcic的答案,因此在执行以下步骤后将其修复:
"react-native": "^0.20.0",
在package.json
node_modules
react-native upgrade
(android/app/build.gradle
其他更新)react-native run-android
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句