My Ionic app doesnt work anymore with android but emulator and iOS work fine - SOLVED - SSL ISSUE

Hello,
i just got a warning from Facebook, during a random check they noticed that my app doesnt load anymore on android and just show an empty screen.

The app works fine on iOS and launching it with “ionic serve”

Ionic CLI                     : 7.2.0 (/usr/local/lib/node_modules/@ionic/cli)
  Ionic Framework               : @ionic/angular 7.6.4
  @angular-devkit/build-angular : 15.2.10
  @angular-devkit/schematics    : 15.2.10
  @angular/cli                  : 15.2.10
  @ionic/angular-toolkit        : 9.0.0

Capacitor:

  Capacitor CLI      : 5.6.0
  @capacitor/android : 5.6.0
  @capacitor/core    : 5.6.0
  @capacitor/ios     : 5.6.0

Utility:

  cordova-res : 0.15.4
  native-run  : 2.0.0

System:

  NodeJS : v18.17.1 (/usr/local/bin/node)
  npm    : 10.2.4
  OS     : macOS Unknown

Do i have to change something somewhere?

Thats way to less information to really help you. I suggest you to try it on a native android device and have a look into the logs

I did it, but nothing shows up, that’s weird.

Did you check the web view logs or native logs in android studio?

i think this is the problem:

2024-01-25 11:44:51.319 12698-12789 TrafficStats            com.nastydevops.singlefin            D  tagSocket(172) with statsTag=0xffffffff, statsUid=-1
2024-01-25 11:44:51.366 12698-12750 OpenGLRenderer          com.nastydevops.singlefin            W  Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
2024-01-25 11:44:51.366 12698-12750 OpenGLRenderer          com.nastydevops.singlefin            W  Failed to initialize 101010-2 format, error = EGL_SUCCESS
2024-01-25 11:44:51.389 12698-12750 Gralloc4                com.nastydevops.singlefin            I  mapper 4.x is not supported
2024-01-25 11:44:51.395 12698-12750 OpenGLRenderer          com.nastydevops.singlefin            E  Unable to match the desired swap behavior.
2024-01-25 11:44:51.437 12698-12743 TrafficStats            com.nastydevops.singlefin            D  tagSocket(198) with statsTag=0xffffffff, statsUid=-1
2024-01-25 11:44:52.321 12698-12905 cr_X509Util             com.nastydevops.singlefin            I  Failed to validate the certificate chain, error: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
2024-01-25 11:44:52.322 12698-12941 chromium                com.nastydevops.singlefin            E  [ERROR:ssl_client_socket_impl.cc(992)] handshake failed; returned -1, SSL error code 1, net_error -202
2024-01-25 11:44:52.387 12698-12941 chromium                com.nastydevops.singlefin            E  [ERROR:ssl_client_socket_impl.cc(992)] handshake failed; returned -1, SSL error code 1, net_error -202
2024-01-25 11:44:52.429 12698-12941 chromium                com.nastydevops.singlefin            E  [ERROR:ssl_client_socket_impl.cc(992)] handshake failed; returned -1, SSL error code 1, net_error -202
2024-01-25 11:44:52.483 12698-12941 chromium                com.nastydevops.singlefin            E  [ERROR:ssl_client_socket_impl.cc(992)] handshake failed; returned -1, SSL error code 1, net_error -202

Might be, definitively looks wrong :smiley:

but i don’t understand why, it should be broken on both android and ios devices, isn’t it?

I don’t know the error and its cause but of course there are errors that only happen on one platform

i will try to investigate, thank you.

i have an ssl certificate with sectigo
but i dont know what happened to be honest, since in safari it works fine

Android has usually more problems with incorrectly configured certificates, things that work on iOS or browsers fail on Android, like missing intermediate certificates (or expired), not to mention that different Android versions have different trusted certificates.
But if it’s failing suddenly I would think it’s because something expired.

Does it also fail in your debug version? did you check if there are any errors on chrome://inspect/#devices?
Do you use a custom scheme to load or http/https, because there was a WebView update a few months ago that broke navigation when using custom schemes and I think it could also cause white screens.

thank you for your reply.

i guess the problem is with ssl certificate: