React Native Could not connect to development server

It’s my first time to meet this issue when i use React-Native 0.57.0
Two Solution share to you:
First: checked the main.jsbundle > project/ios/main.jsbundle.
(you can pass this step if you already have main.jsbundle)
Then, cd yourProject/ios
Then,entry react-native bundle — entry-file index.js — platform ios — bundle-output ./main.jsbundle
Then, open Xcode, add main.jsbundle with Add files to Project.
Second: go to Build Phases, delete the Bundle React Native code and Images Run scripts(remember to copy your script), add New Run Script Phase named (Bundle React Native code and Images), paste script, Product clean, Product Build.
I just followed these two step to fixed my issue.
Hopen can help you.

React Native Could not connect to development server 這問題最近常常發生!

我的react native 版本是 0.57
之前使用都正常, 開始發生錯誤是在移除了 react-native-google-signin 項目開始.
我用了下面兩個方式來暫時解決我的問題:
1: 我發現我的 project/ios/main.jsbundle. 不知何時移除了@@?
所以我先創建 main.jsbundle
cd 到你的專案/ios 內, 輸入react-native bundle — entry-file index.js — platform ios — bundle-output ./main.jsbundle
產出的main.jsbundle 在Xcode 內 點選 Add Files to 你的專案 把它加進去.
2: 到 Build Phases 內, 刪除Bundle React Native code and Images 這個 Run Script(刪除前記得先把script 複製一份).然後再新增名為 Bundle React Native code and Images 的 新腳本. 貼上先前腳本後.
清除專案, 再重新Build.
試看看 或許有幫助!
在實機測試前, 記得先排除不是因為 wifi 連線不同導致喔!!!
不然就白做工了~

留言

這個網誌中的熱門文章

React Native 系列教學(一)

Expo 是天堂還是地獄?

Jquery on scroll 事件