Network error in axios and react-native after bundle release
See original GitHub issueI’m using react-native and axios to request,in debug model,everything is fine,but when bundle release,it occurs to the ‘Network error’ in my phone. React Native version:0.60.4
System: OS: Windows 10 CPU: (8) x64 Intel® Core™ i7-4790 CPU @ 3.60GHz Memory: 2.70 GB / 7.89 GB Binaries: Node: 10.15.3 - D:\node\node.EXE Yarn: 1.16.0 - D:\node\yarn.CMD npm: 6.4.1 - D:\node\npm.CMD
Steps To Reproduce
- cd android
- ./gradlew assembleRelease
- and install the bundle apk file in my phone
- when i request use axios,the error just happended
- but when i run react-native run-android,everything is fine.
Describe what you expected to happen:
it is normal in bundle release.
Snack, code example, screenshot, or link to a repository:
Issue Analytics
- State:
- Created 4 years ago
- Reactions:10
- Comments:8
Top Results From Across the Web
Network error with axios and react native - Stack Overflow
If you are trying to call localhost on android simulator created with AVD, replacing localhost with 10.0.2.2 solved the issue for me.
Read more >React Native [AxiosError: Network Error] HTTP Fetching iOS ...
React Native cannot fetching using HTTP, so need HTTPS for ... React Native [ AxiosError : Network Error ] HTTP Fetching iOS and...
Read more >Using Axios with React Native to manage API requests
Learn how to supercharge your API network requests in React Native with Axios in this comprehensive tutorial.
Read more >React Native throw Network Error when using Axios or Fetch ...
Coding example for the question React Native throw Network Error when using Axios or Fetch in android-React Native.
Read more >Axios Network Error when making HTTP request [Solved]
The URL has to include the protocol, e.g. http:// or https:// if you're testing on localhost without an SSL certificate. · The path...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Try
"Content-Type": "application/x-www-form-urlencoded",
Accept: "application/json"
Same here. “react-native”: “0.59.3”
I found the solution : https://github.com/facebook/react-native/issues/24039