Android build crashes after following href='mailto:example@example.com'

Hello! I supposed it would be very easy to do this. If I put an external http link, the app opens the default native browser to follow the link, but it crashes trying to follow the mailto, no email client got opened. I tried different ways of opening the “mailto:…” but none with success.

The errors that I can see in Android Studio are:

E/AndroidRuntime: FATAL EXCEPTION: main
Process: ionic.hola, PID: 10208
java.lang.NullPointerException: Attempt to invoke virtual method ‘boolean java.lang.String.equals(java.lang.Object)’ on a null object reference
at com.getcapacitor.Bridge.launchIntent(Bridge.java:374)
at com.getcapacitor.BridgeWebViewClient.shouldOverrideUrlLoading(BridgeWebViewClient.java:28)
at org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading(chromium-TrichromeWebViewGoogle6432.apk-stable-506007137:46)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:335)
at android.os.Looper.loopOnce(Looper.java:161)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7872)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

I have this element rendered in ionic and the app crashes when I press the link in the screen:

Send Mail

Is it normal that this doesn’t work?

Thank you!!!

It’s a known bug that has been fixed but not released yet

1 Like

Thank you. I will be paying attention to that :slight_smile: