New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Network request failed" only when using network shared from iPhone 4G/LTE hotspot #844
Comments
@josephtsng - does this always happen when using it from your iPhone 4G/LTE hotspot? Could you post the code that caused this as well? |
@brentvatne Yes it always happens. The code is mostly from React Native tutorial app with minor editing.
|
@josephtsng what's the error message? You posted just stack trace. Try this simplified example: var React = require('react-native');
var {
AppRegistry,
StyleSheet,
Text,
View,
} = React;
var fetch = require('fetch');
var REQUEST_URL = 'https://raw.githubusercontent.com/facebook/react-native/master/docs/MoviesExample.json';
var TestFetch = React.createClass({
componentDidMount: function() {
fetch(REQUEST_URL)
.then((response) => response.json())
.then((stuff) => console.log(stuff))
.done();
},
render: function() {
return (
<View />
);
}
}); |
@frantic I tried with your simplified example and got the same message as below:
|
You could try resetting the simulator which sometimes fixes network issues: http://stackoverflow.com/questions/2763733/how-to-reset-iphone-simulator. Could there be something wrong with the URL or your setup (ex: try not using the Chrome debugger, make sure all URLs have hosts publicly accessible from the internet)? |
@ide It works (resetting the simulator)! Thanks for giving me a hand. Previously I also encountered another issue that was solved by the same mean. Could you know why it is caused? |
@ide Unfortunately after resetting the simulator running either the simple app frantic suggests or the one I posted will freeze. Occasionally I saw the same error messages in the Xcode console, but now I could see the data info (JSON or the ListView) before it hangs. I'll try to switch to the WiFi router to test this and report. However I think it might be some system issue of my own. |
Solved after restarting Xcode. It seems there's something wrong with the resource management on my laptop. |
I ran into this problem only when I use network shared from my iPhone 4G/LTE hotspot. This won't be seen when connecting to a WiFi AP. Could anyone help? Here's the detailed error message:
The text was updated successfully, but these errors were encountered: