Quantcast
Viewing all articles
Browse latest Browse all 17050

Network error between Rails and React Native with ios/android devices

I'm having an issue with Rails and React Native. Here's an overview of the structure.

Rails is running at 8080RN is running at 8081React is running at 3000

When I run either ios Simulator or android emulator, there's no issue at all. However, whenever I try to run the app on the actual devices (both ios and android), I never hear back from Rails.

I've verified that

  1. both my local server and devices are under the same network
  2. rails (5.2) is binding 0.0.0.0
  3. I can access 3000, 8080, and 8081 individually from the device browser.

Here's the error I'm getting on React Native console:

 {"message":"ERR: Could not create device","error":{"message":"Network Error","name":"Error","stack":"createError@http://192.168.29.210:8081/index.bundle?platform=ios&dev=true&minify=false:106824:26\nhandleError@http://192.168.29.210:8081/index.bundle?platform=ios&dev=true&minify=false:106726:27\ndispatchEvent@http://192.168.29.210:8081/index.bundle?platform=ios&dev=true&minify=false:34174:31\nsetReadyState@http://192.168.29.210:8081/index.bundle?platform=ios&dev=true&minify=false:33258:33\n__didCompleteResponse@http://192.168.29.210:8081/index.bundle?platform=ios&dev=true&minify=false:33085:29\nemit@http://192.168.29.210:8081/index.bundle?platform=ios&dev=true&minify=false:7038:42\n__callFunction@http://192.168.29.210:8081/index.bundle?platform=ios&dev=true&minify=false:2781:49\nhttp://192.168.29.210:8081/index.bundle?platform=ios&dev=true&minify=false:2503:31\n__guard@http://192.168.29.210:8081/index.bundle?platform=ios&dev=true&minify=false:2735:15\ncallFunctionReturnFlushedQueue@http://192.168.29.210:8081/index.bundle?platform=ios&dev=true&minify=false:2502:21\ncallFunctionReturnFlushedQueue@[native code]","config":{"url":"http://localhost:8080/api/devices","method":"post","data":"{\"uuid\":\"ebd62609-92f4-4745-9c26-0db263e44e76\",\"player_id\":null}","headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json;charset=utf-8"},"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1}}}
Possible Unhandled Promise Rejection (id: 0):Error: Network ErrorcreateError@http://192.168.29.210:8081/index.bundle?platform=ios&dev=true&minify=false:106824:26handleError@http://192.168.29.210:8081/index.bundle?platform=ios&dev=true&minify=false:106726:27dispatchEvent@http://192.168.29.210:8081/index.bundle?platform=ios&dev=true&minify=false:34174:31setReadyState@http://192.168.29.210:8081/index.bundle?platform=ios&dev=true&minify=false:33258:33__didCompleteResponse@http://192.168.29.210:8081/index.bundle?platform=ios&dev=true&minify=false:33085:29emit@http://192.168.29.210:8081/index.bundle?platform=ios&dev=true&minify=false:7038:42__callFunction@http://192.168.29.210:8081/index.bundle?platform=ios&dev=true&minify=false:2781:49http://192.168.29.210:8081/index.bundle?platform=ios&dev=true&minify=false:2503:31__guard@http://192.168.29.210:8081/index.bundle?platform=ios&dev=true&minify=false:2735:15callFunctionReturnFlushedQueue@http://192.168.29.210:8081/index.bundle?platform=ios&dev=true&minify=false:2502:21callFunctionReturnFlushedQueue@[native code]

Most of the answers found here is solved with 0.0.0.0 binding. Which piece am I missing?


Viewing all articles
Browse latest Browse all 17050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>