I’m facing a mysterious crash with the following scenario:
- Launch the app
- Lock the device
- Unlock the device (with home button)
- Make an HTTP request
- The app crashes
I can’t reproduce it on the simulator, only on a real device, and I can’t debug the crash:
- The debugger detaches when the device gets locked
- Even if I declare a custom UncaughtExceptionHandler to print the stack trace, nothing appears
so I don’t kown what is happening.
The only thing I’m sure of, is that the crash happens immediately after a call to an HTTP API. I can log the call, and sometimes the result (not always), then the app crashes.
I use Retrofit for the all the network part, so I can’t manage the connections myself. I’ve read in this post that it could be a matter of unclosed session.
How can I deal with this problem? Has anyone already faced the same crash?