Listen有着建立在我的Windows機器本地做出反應,它不斷給我跑反應母語開始時,此消息:陣營機錯誤打包程序無法在端口8081
錯誤打包不能監聽端口8081
好了,我改變它每指令:
反應本土開始--port = 8088
這個偉大的工程和I R eceive這樣的:
[12/24/2016, 10:03:33 AM] HMR Server listening on /hot
React packager ready.
[12/24/2016, 10:03:41 AM] <START> Initializing Packager
[12/24/2016, 10:03:41 AM] <START> Building in-memory fs for JavaScript
[12/24/2016, 10:03:41 AM] <END> Building in-memory fs for JavaScript (103ms)
[12/24/2016, 10:03:41 AM] <START> Building Haste Map
[12/24/2016, 10:03:41 AM] <END> Building Haste Map (64ms)
[12/24/2016, 10:03:41 AM] <END> Initializing Packager (221ms)
因此,作爲指示我,然後運行這個命令:
C:\ ReactProjects \ AwesomeProject>反應本地運行的Android
而得到這樣的:
JS server not recognized, continuing with build...
Running C:\Users\<user>\AppData\Local\Android\sdk/platform-tools/adb -s emulator-5554 reverse tcp:8081 tcp:8081
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
JS server not recognized, continuing with build...
Running C:\Users\<user>\AppData\Local\Android\sdk/platform-tools/adb -s emulator-5554 reverse tcp:8081 tcp:8081
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
.
.
.
BUILD SUCCESSFUL
Total time: 19.304 secs
Starting the app on emulator-5554 (C:\Users\<user>\AppData\Local\Android\sdk/platform-tools/adb -s emulator-5554 shell am start -n com.awesomeproject/.MainActivity)...
Starting: Intent { cmp=com.awesomeproject/.MainActivity }
不幸的是仿真器給我:
「Could not get BachedBridge, make sure your bundle is packaged correctly」
因此,有表示國家必須更改模擬器上的端口的說明,但我使用運行MARSHMELLOW了Nexus 5,不能找到該設置:
You will also need to update your applications to load the JavaScript bundle
from the new port. Open the in-app Developer menu, then go to Dev Settings → Debug
server host for device and replace 8081 with your port of choice.
人有如何設置一個想法模擬器識別包裝商?
由sumit6b解決方案從這裏工作,我殺了那個過程://github.com/facebook/react-native/issues/9336 – niltoid
不幸的是,我們在我們的系統上安裝了邁克菲8081.所以我們需要能夠設置不僅包裝器的端口,而且還需要模擬器。似乎它是使用打包程序進行仿真的硬編碼。似乎React的發展很糟糕。應該很簡單,這是浪費時間。 – pthorsey
好了畢竟我只是放棄了Android模擬器上的crapy效果。我很樂意向我的公司提出這個建議,但是React與包裝工人的問題很混亂,還不夠成熟。我終於用了我的Android手機,並在一天內給它打了個電話。多麼浪費時間。過去曾經使用過許多不同的模擬器,而且這些開發很糟糕。現在將看到開發人員的其餘部分如何構建React本機應用程序。 – pthorsey