Bridging from java to javascript does not work anymore (black screen on android)

We use capacitor a while and notice that our android apps stopped working,
starting the app gets a black screen (before it worked).

Via debugging we see that the following error is thrown:
Uncaught TypeError: window.android.initMenuBar is not a function

also
console.log(JSON.stringify(window.android))
→ {}

We use window.android to call native android function from javascript code,
which worked in the past, but not anymore.

Also tried upgrading the app to capacitor 6, which did not resolve the issue,
bundle and install works (same error message).

I hope that someone else is encountering the issue and have some insights
or maybe can help use.

Best regards,
Daniel

I’ve never heard of calling native code with Capacitor through window.android. I could be wrong though.

Is there a reason you are not using the standard Capacitor way of a plugin? Custom Native Android Code | Capacitor Documentation

Thanks for your post and the link to the plugin, we will take a look at it.

We did not built the android app from scratch with capacitor,
we used the window.android-Calls to communicate from javascript to native android java
(via androids JavascriptInterface), maybe we have to use or write a capacitor plugin
to achieve this.