is it possible to use Kotlin as a framework/language as a Cordova plugin?
first issue is that it's not copying the .kt file, because it looks for *.java or *.xml
if so anyone know a reference on how to setup?
Recently I've been working with Kotlin in Cordova plugins, but when I started out I also couldn't find any existing references as to how to create a Cordova plugin using Kotlin.
So I've created an example plugin which you can use as a template:
https://github.com/dpa99c/cordova-plugin-hello-kotlin
As you can see, the native part on the Cordova plugin interface is implemented in Kotlin.
Because currently cordova-android@7
doesn't implicitly support Kotlin, the plugin uses hook scripts to set up the native Android project created by Cordova for Kotlin, and also to remove .kt
files from the platform project when the plugin is uninstalled, since currently cordova-android@7
only does this for .java
files.
But it works and you can try it out with the test app project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With