React native fetch request won’t work on Android API 16 to 19 after react native upgraded to newer okHttp versions which doesn’t support old cipher suites. To make it work we will have to downgrade okHttp version of react native. I specifically encountered this issue while using API from a site which was hosted on cloudflare. Also not all SSL sites/certificates will give errors but only those which are using cipher suites which are dropped in newer okHttp versions. Only use the below code if your app is having issues.
Use the following code in app/build.gradle
implementation ("com.squareup.okhttp3:okhttp:3.9.0") { force = true; } implementation ("com.squareup.okhttp3:okhttp-urlconnection:3.9.0") { force = true; }
Recent Comments