I am trying to run my React Native app (version 0.59.1) with an Android Device that is API 16 and does not have google play services. My problem is that when I build my app in release mode, calls to my API over HTTPS give me a "Network Error" with no further details. These calls are made using FETCH.
The API calls over HTTPS work fine when running in debug mode. I have also confirmed that just HTTP works when running in release mode.
I've seen several posts that suggest creating my own TLS/SSL connection factory but it seems that React Native should be already handling this with their OkHttpProvider: https://github.com/facebook/react-native/blob/master/ReactAndroid/src/main/java/com/facebook/react/modules/network/OkHttpClientProvider.java
I've also included pro-guard rules shown here: https://stackoverflow.com/a/38484643/3178433
I've also tried turning off pro-guard and that did not seem to make a difference.
Am I missing something? Is there a missing proguard rule? Is the OkHttpClientProvider provided by react not use like I am thinking it is?
Found the solution. I added this proguard rule and problem solved:
-keepclassmembers class * implements javax.net.ssl.SSLSocketFactory {
private final javax.net.ssl.SSLSocketFactory delegate;
}