Issue
I can't be sure it happened because of that but I updated my project name using react-native-rename
and rebuild the project couple of hours later. Since then I cant reload my project on device.
Note
On simulator it works , not working only on real device. Running npm-start
return :
┌──────────────────────────────────────────────────────────────────────────────┐
│ │
│ Running Metro Bundler on port 8081. │
│ │
│ Keep Metro running while developing on any JS projects. Feel free to │
│ close this tab and run your own Metro instance if you prefer. │
│ │
│ https://github.com/facebook/react-native │
│ │
└──────────────────────────────────────────────────────────────────────────────┘
Looking for JS files in
/Users/Project/Client
Metro Bundler ready.
Loading dependency graph, done.
and never updating no matter what. I tried to look for .lock
inside .git
as suggested here #4357 but I can't find the .git
directory so I believe it isnt the issue.
I also tried rm -rf /usr/local/var/run/watchman && brew uninstall watchman && brew install watchman
as suggested here #10889 without any luck.
Along the route I tried as well watchman watch-del-all
and rm -fr /usr/local/var/run/watchman/$USER-state
Solution
You should set a debug server address for a real device.
- Make sure your laptop and your phone are on the same Wi-Fi network.
- Open your React Native app on your device.
- You'll see a red screen with an error. This is OK. The following steps will fix that.
- Open the in-app Developer menu.
- Go to Dev Settings → Debug server host for device.
- Type in your machine's IP address and the port of the local dev server (e.g. 10.0.1.1:8081).
- Go back to the Developer menu and select Reload JS.
https://facebook.github.io/react-native/docs/running-on-device.html#method-2-connect-via-wi-fi
Answered By - sametcodes
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.