1

I tried to make json requests, load images/videos from the local network with http ( not https), but it randomly fails. Sometimes the connection is closed before the data is received. The same error happens if I open Chrome, so it is not an error in my app.

How is it possible to debug an error like this?

Iter Ator
  • 8,226
  • 20
  • 73
  • 164
  • 1. It's not android related if it happens in chrome too. 2. What error do you get? A javascript error? A HTTP 404/403/503? 3. If your app is built using webview, You can debug the error via Chrome's Dev Tools, the same way you would if it wasn't an app. – Eliezer Berlin Sep 11 '20 at 04:28
  • HTTP has errors, but HTTPS doesn't? That sounds like a server configuration problem. – Eliezer Berlin Sep 11 '20 at 04:29

1 Answers1

1

If the problem happens in Chrome, too, you can debug errors via Remote Debugging.

Instructions: https://developers.google.com/web/tools/chrome-devtools/remote-debugging

In summary, you

  1. Enable Developer Tools, and USB debugging on your phone.
  2. Connect your phone to a computer via cable.
  3. Turn Chrome on in both the phone and computer.
  4. Use Remote debugging to use the computer's Chrome Dev Tools to inspect the Android tab.
  5. Debug as normal, checking the console for network or javascript errors.
Eliezer Berlin
  • 3,170
  • 1
  • 14
  • 27