Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 29622

network request fail in react-native android for a specific url

$
0
0

I started a react-native app for android. I decided to run this function:

fetch("https://icmsrv.com:8010/activity")
.then(response=>response.json())
.then(result=>console.log(result))
.catch(e=>console.log("Failed - ",{...e}, e));

In both the android emulator and my physical android phone, I get the error Failed - {"column": 31, "line": 26759, "sourceURL": "http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false"} [TypeError: Network request failed].

If I visit https://icmsrv.com:8010/activity in a browser I see that it will load fine. If I run the same fetch statement from a browser console or a react-native-web app, I do not get any issues.

If I change the url to https://academy.evermight.com/content/index.php, the fetch statement works fine in my react-native android app. so maybe there is an SSL configuration issue with icmsrv.com?

My Android Manifest file already has this:

<application
 ....
 android:usesCleartextTraffic="true"

EDIT

I can reproduce a similar error in POSTMAN if I enable Verify SSL and then use fetch("https://icmsrv.com:8010/activity"). So my question is, for development purposes, is there a way to disable Verify SSL for react-native fetch?


Viewing all articles
Browse latest Browse all 29622

Trending Articles



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