DEV Community


Running http requests in release build android react native

coucoseth profile image ochieng seth ・1 min read

For android version 9 and above, http requests wont be successful for your react native apps and this may lead to app crashes simply because RN's networking native module blocks insecure connections by default.
The best solution is to change your api calls to https, however if its a must for you to use http then head over to your main AndroidManifest.xml file and add this line
xmlns:tools="" to the <manifest tag so it looks like so,
<manifest xmlns:tools="">
PS. do not delete any other code inside the <manifest
we aren't done.. head down to the <application tag and add android:usesCleartextTraffic="true" tools:targetApi="28" so it looks like so <application android:usesCleartextTraffic="true" tools:targetApi="28" >
There you have it. Enjoy

Discussion (0)

Forem Open with the Forem app