Is there any documentation about how to use kotlinc cli with Android support? The only thing I can find online is a very old reddit reply[1], and kotlin-android-compiler-plugin it mentioned was last updated on 2015-03-10 on maven[2], that’s 2 years ago! Also I cannot get it to work with kotlinc 1.1.0:
$ kotlinc -Xplugin ../kotlin-android-compiler-plugin-0.10.1316.jar -P plugin:org.jetbrains.kotlin.android:androidManifest=AndroidManifest.xml -P plugin:org.jetbrains.kotlin.android:androidRes=res/ main.kt
exception: java.lang.NoClassDefFoundError: kotlin/jvm/internal/KObject
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at org.jetbrains.kotlin.cli.jvm.PluginURLClassLoader$SelfThenParentURLClassLoader.findClass(PluginCliParser.kt:120)
at org.jetbrains.kotlin.cli.jvm.PluginURLClassLoader.loadClass(PluginCliParser.kt:102)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:370)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
at kotlin.collections.CollectionsKt___CollectionsKt.toCollection(_Collections.kt:1038)
at kotlin.collections.CollectionsKt___CollectionsKt.toMutableList(_Collections.kt:1071)
at org.jetbrains.kotlin.cli.jvm.PluginCliParser.loadPlugins(PluginCliParser.kt:41)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:72)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:55)
at org.jetbrains.kotlin.cli.common.CLICompiler.exec(CLICompiler.java:191)
at org.jetbrains.kotlin.cli.common.CLICompiler.exec(CLICompiler.java:138)
at org.jetbrains.kotlin.cli.common.CLICompiler.exec(CLICompiler.java:65)
at org.jetbrains.kotlin.cli.common.CLICompiler.doMainNoExit(CLICompiler.java:402)
at org.jetbrains.kotlin.cli.common.CLICompiler.doMain(CLICompiler.java:386)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler$Companion.main(K2JVMCompiler.kt:287)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.main(K2JVMCompiler.kt)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.jetbrains.kotlin.preloading.Preloader.run(Preloader.java:73)
at org.jetbrains.kotlin.preloading.Preloader.main(Preloader.java:35)
Caused by: java.lang.ClassNotFoundException: kotlin.jvm.internal.KObject
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.jetbrains.kotlin.preloading.MemoryBasedClassLoader.loadClass(MemoryBasedClassLoader.java:75)
at org.jetbrains.kotlin.preloading.MemoryBasedClassLoader.loadClass(MemoryBasedClassLoader.java:82)
at org.jetbrains.kotlin.preloading.MemoryBasedClassLoader.loadClass(MemoryBasedClassLoader.java:75)
at org.jetbrains.kotlin.preloading.MemoryBasedClassLoader.loadClass(MemoryBasedClassLoader.java:82)
at org.jetbrains.kotlin.preloading.MemoryBasedClassLoader.loadClass(MemoryBasedClassLoader.java:75)
at org.jetbrains.kotlin.preloading.MemoryBasedClassLoader.loadClass(MemoryBasedClassLoader.java:82)
at org.jetbrains.kotlin.cli.jvm.PluginURLClassLoader$SelfThenParentURLClassLoader.findClass(PluginCliParser.kt:123)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 35 more
Any help is appreciated.
[1] https://www.reddit.com/r/Kotlin/comments/3h6u85/android_extensions_from_command_line_compiler/cu4ve4c/
[2] Maven Central Repository Search