我最近升级到 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。
有什么建议吗?
最佳答案
需要将android/app/build.gradle中的字符串更新为
dependencies {
compile "com.facebook.react:react-native:0.20.+"
}
然后就跑
npm start
react-native run-android
关于android - React Native Android : screenPhysicalPixels. 宽度未定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35609603/