Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 当我尝试在windows中运行react本机示例时,Dimensions.get(';window';)错误_Reactjs_React Native - Fatal编程技术网

Reactjs 当我尝试在windows中运行react本机示例时,Dimensions.get(';window';)错误

Reactjs 当我尝试在windows中运行react本机示例时,Dimensions.get(';window';)错误,reactjs,react-native,Reactjs,React Native,我想设置windows react本机开发环境并学习 来自react本机文件夹的示例 示例apk可以安装在我的android虚拟机上 但当我点击它时,它会弹出红色屏幕,如: 和我的打包机控制台错误: SyntaxError: Unexpected end of JSON input at parse (native) at process._tickCallback (internal/process/next_tick.js:109:7) { Error: write EPI

我想设置windows react本机开发环境并学习 来自react本机文件夹的示例

示例apk可以安装在我的android虚拟机上

但当我点击它时,它会弹出红色屏幕,如:

和我的打包机控制台错误:

SyntaxError: Unexpected end of JSON input
    at parse (native)
    at process._tickCallback (internal/process/next_tick.js:109:7)
{ Error: write EPIPE
    at exports._errnoException (util.js:1018:11)
    at Socket._writeGeneric (net.js:715:26)
    at Socket._write (net.js:734:8)
    at doWrite (_stream_writable.js:334:12)
    at writeOrBuffer (_stream_writable.js:320:5)
    at Socket.Writable.write (_stream_writable.js:247:11)
    at Socket.write (net.js:661:40)
    at Socket.Writable.end (_stream_writable.js:480:10)
    at Socket.end (net.js:431:31)
我尝试在chrome上进行跟踪和调试,发现:

return Dimensions.get('window').scale;
出现如下错误:

Uncaught Error: No dimension set for key window
    at invariant (http://localhost:8081/Examples/UIExplorer/js/UIExplorerApp.android.bundle?platform=android&dev=true&hot=false&minify=false:2504:15)
    at Function.get (http://localhost:8081/Examples/UIExplorer/js/UIExplorerApp.android.bundle?platform=android&dev=true&hot=false&minify=false:17698:7)
    at eval (eval at evaluate (:85:21), <anonymous>:1:12)
    at Function.get (http://localhost:8081/Examples/UIExplorer/js/UIExplorerApp.android.bundle?platform=android&dev=true&hot=false&minify=false:17620:7)
    at Function.roundToNearestPixel (http://localhost:8081/Examples/UIExplorer/js/UIExplorerApp.android.bundle?platform=android&dev=true&hot=false&minify=false:17635:30)
    at http://localhost:8081/Examples/UIExplorer/js/UIExplorerApp.android.bundle?platform=android&dev=true&hot=false&minify=false:17557:32
    at loadModuleImplementation (http://localhost:8081/Examples/UIExplorer/js/UIExplorerApp.android.bundle?platform=android&dev=true&hot=false&minify=false:109:5)
    at guardedLoadModule (http://localhost:8081/Examples/UIExplorer/js/UIExplorerApp.android.bundle?platform=android&dev=true&hot=false&minify=false:70:12)
    at _require (http://localhost:8081/Examples/UIExplorer/js/UIExplorerApp.android.bundle?platform=android&dev=true&hot=false&minify=false:54:60)
    at http://localhost:8081/Examples/UIExplorer/js/UIExplorerApp.android.bundle?platform=android&dev=true&hot=false&minify=false:18886:18
Uncaught错误:键窗口未设置维度
at不变量(http://localhost:8081/Examples/UIExplorer/js/UIExplorerApp.android.bundle?platform=android&dev=true&hot=false&minify=false:2504:15)
在Function.get(http://localhost:8081/Examples/UIExplorer/js/UIExplorerApp.android.bundle?platform=android&dev=true&hot=false&minify=false:17698:7)
评估时(评估时的评估(:85:21)

任何帮助都将不胜感激


谢谢你,并致以最良好的问候。

你能得到任何要渲染的东西吗,或者是该应用程序特有的功能吗?你是说该应用程序最初渲染,但当你尝试与它交互时,你会出错?@Adam,谢谢你的回复。这是我在模拟器上单击应用程序图标时发生的,没有交互。但我可以运行AwesomeProject。你要回答我的问题吗?很抱歉,我的网速太慢,错误发生在我打开UIExplorer示例时,我什么也没做……如果你是用HTTPS下载依赖项,这篇文章可能会有所帮助:否则,你可能想重新安装所有内容,你可能缺少依赖项。