I’m trying to build an Android project using the andoird-maven-plugin and the kotlin-maven-plugin. Basically, it’s working pretty well, instead of a small issue.
The android-maven-plugin auto-generates resource classes (R.class, BuildConfig.class, …) and places them under target/classes. The kotlin-maven-plugin runs afterwards and compiles kotlin sources that reference those resources and places them also under target/classes. Unfortuantely, the directory target/classes itself isn’t on the classpath so the referenced resources are not found. As a workaround, I’ve added the target directory to the classpath by doing this…
Hi Philipp,
R-classes is an android-specific feature and, as I already told you, kotlin-maven plugin for android isn't implemented yet.
It seems that you will also have problems with kotlin external annotations for android sdk.
May be it isn’t too late to recommend you to use gradle as a build system?
yeah, I had problems with the annotations. I solved it by adding the annotations jar to the dependencies.
I’ve changed the build system to gradle and it’s working much better now. The issue I’ve now is, that the kdoc task isn’t working anymore. It would be useful to have some documentation about how to set it up. Is there any? Or maybe some example code?