我最近升级到RN 0.20,当我尝试加载我的应用程序时,我现在抛出以下异常: undefined is not an object (evaluating 'screenPhyisicalPixels.width')unknownindex.android.bundle?platform=android def=true:32950requireImplinde
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