We've spent a lot of time trying to debug this issue with no success.
When we compile our React Native Android app in release mode the HTTP requests are taking (what seems to be) 90 seconds before the promises are returned. We believe this may only affect POST, PUT and PATCH methods not GET for some reason.
We cannot reproduce this issue in an emulator either.
We have checked the server logs and the requests are being received instantly.
We have 3 client environments:
- Development (NO IPV6 support)
- Staging (with IPV6 support)
- Production (with IPV6 support)
There is plenty of documented issues around the Native Android HTTP issues, especially around IPV6 which is our best guess at this point for our issue.
We have tried both axios and fetch and the same issue occurs.
We have followed the suggestions in this thread (to force IPV4 preference):
We have also switched out okhttp4 for okhttp5-alpha-10 as per these instructions
How to implement okhttp 5.0.0 in react native module
But neither solution solve our problem.
We're completely stumped why this is only effecting release builds and not debug nor IPV6 enabled servers.