Fetching non-https url are failing after updating sdk version to 26. This happens only in production build. In development mode everything works fine. Here is the piece of code:
fetch('http://something.com/').then(
r => {},
e => console.error(e));
This produces the following in logcat:
08-12 19:08:47.555 14586 14623 E ReactNativeJS: [TypeError: Network request failed]
Here is my android/app/build.gradle
file:
android {
compileSdkVersion 23
buildToolsVersion "27.0.3"
defaultConfig {
...
minSdkVersion 16
targetSdkVersion 26
versionCode 28
versionName "0.1.0"
}
...
}
Try with some other http client, for example axios
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With