React-native: Network error in axios and react-native after bundle release

Created on 27 Aug 2019  路  8Comments  路  Source: facebook/react-native


I'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(R) Core(TM) i7-4790 CPU @ 3.60GHz
Memory: 2.70 GB / 7.89 GB
Binaries:
Node: 10.15.3 - D:nodenode.EXE
Yarn: 1.16.0 - D:node\yarn.CMD
npm: 6.4.1 - D:nodenpm.CMD

Steps To Reproduce

  1. cd android
  2. ./gradlew assembleRelease
  3. and install the bundle apk file in my phone
  4. when i request use axios锛宼he error just happended
  5. but when i run react-native run-android锛宔verything is fine.

image

Describe what you expected to happen:

it is normal in bundle release.

Snack, code example, screenshot, or link to a repository:
image
image

Bug iOS 馃摝Bundler

Most helpful comment

Same here. "react-native": "0.59.3"

I found the solution : https://github.com/facebook/react-native/issues/24039

All 8 comments

I'm having the same issue

Same here. "react-native": "0.59.3"

I found the solution : https://github.com/facebook/react-native/issues/24039

Same here. "react-native": "0.59.3"

I found the solution : #24039

I was just about to post the same, Thanks!

Same here. "react-native": "0.59.3"
I found the solution : #24039

I was just about to post the same, Thanks!

bro,thanks a lot!!

Same here. "react-native": "0.59.3"
I found the solution : #24039

I was just about to post the same, Thanks!

Thank you very much!

Try
"Content-Type": "application/x-www-form-urlencoded",
Accept: "application/json"

Im getting the same Error: Network Error in the catch when i was trying to call axios api with socket url : http://127.0.0.1:3000. but when i connected to the live socket url it's working fine.

Same here. "react-native": "0.59.3"

I found the solution : #24039

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lazywei picture lazywei  路  3Comments

vikeri picture vikeri  路  3Comments

grabbou picture grabbou  路  3Comments

oney picture oney  路  3Comments

jlongster picture jlongster  路  3Comments