Cordova plugins with Capacitor - not working when build to signed APK / production mode

Hi,

I’m using the Insomnia plugin: https://ionicframework.com/docs/native/insomnia
It works fine when debugging my app, but when I build the signed APK, it stops working - giving me the following error:

java.lang.ClassNotFoundException: nl.xservices.plugins.Insomnia

I ran into the same issue with the App Preferences plugin, and had to actually user another native function to replace the plugin.

Do you know why this happens? That a plugin stops working with the signed APK version of the Build?
Any hint as what shall I do to avoid this kind of issue?

Thank you for your help.