-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
Fetch failures on Android #29782
Comments
Are you using a localhost api? If so try changing the target url to http://10.0.2.2 for android emulator and if you are trying it on a real device try changing the endpoints to your computer's local IP address. But it is strange that it used to work before v0.61.5 |
Ty! No, this is for a hosted API, not on local, using https. |
|
It's very similar, but I think that issue might be running into broader problems. I'm trying to keep this issue open and focused on the presence of |
Hi @ambarc looks like the issue I linked is closed and the author provided a bunch of details to resolve it. Could you give that a shot? |
A similar solution worked for me. My local Rails API was running on It now works on my Android emulator and device. |
Hey @ambarc, leaving a comment to say thank you for sharing this, after many long hours and testing of different RN versions to try and narrow my problem, this has solved it for me. My research has found that my issue showed up with the upgrade of android SDK versions specified in the Modifying my HTTP service to create the headers via I am really curious to know if this is purely a type error and why RN / fetch API throws an error for this so strictly. Anyway, thanks for sharing, very grateful. |
+1 |
This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days. |
This issue was closed because the author hasn't provided the requested feedback after 7 days. |
Please provide all the information requested. Issues that do not follow this format are likely to stall.
Description
Fetch POST and PUT requests, to https endpoints, fail with "Network request failed", on android simulator. We're observing this after upgrading from 0.59.10 to 0.61.5. We can't upgrade further (yet) given other dependencies breaking.
Observation: Adding a Header object to these requests, as opposed to empty, or JS' empty object
{}
, leads to different behavior. All these requests work as-is on iOS. See simplified code samples.React Native version: 0.61.5
Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.
Expected Results
Expect prior requests from 0.59.10, as described above, to work across iOS and Android.
Snack, code example, screenshot, or link to a repository:
See above.
The text was updated successfully, but these errors were encountered: