Has anybody managed to compile an android library with gradle?
I have tried to use the ‘kotlin-android’ plugin, but it seems to only work for android modules, not android library modules.
I get the following error:
Gradle: Execution failed for task ‘compileDebugKotlin’.
> Plugin with id android has not been used.
I looked at the code for the plugin, and I think I found the source of the problem:
It calls project.getPlugins().getPlugin(“android”) and expects null if “android-library” is used, in which case it then calls getPlugin(“android-library”)
According to the gradle doc, getPlugin() throws an exception instead of returning null. .hasPlugin() should be used instead to check if a plugin is used or not.
I have created an issue in youtrack: