invokevirtual
← Back to Projects
Open Source

kotlinc-android

Kotlin and Java compiler port for Android.

30 stars 0 forks View on GitHub →
KotlinJavaAndroid Runtime

A custom port and adaptation of the Kotlin compiler toolchain designed to run natively on Android devices. Provides on-device Kotlin compilation for mobile development environments and IDEs.

Key Features

Compiler Architecture on Android

The official JetBrains Kotlin compiler (kotlinc) is heavily coupled with standard desktop Java virtual machine behaviors, relying extensively on dynamic classloading, NIO filesystem abstractions, and substantial memory allocations that are incompatible with Android's Dalvik/ART execution environment.

kotlinc-android provides patched, standalone builds of the Kotlin compiler pipeline tailored specifically for mobile and embedded developer applications. It powers mobile IDEs like Cosmic IDE, enabling developers to write, compile, and run Kotlin code natively on Android smartphones and tablets.

Key Technical Adaptations

Modern Language Specs

Maintains support through Kotlin 2.4 and 2.5 compiler iterations, including coroutines, smart casting, and modern standard library bindings.

fastJarFileSystem Integration

Incorporates an optimized in-memory JAR virtual filesystem to drastically accelerate classpath scanning on mobile flash storage.

JitPack Artifacts

Packaged and deployed via JitPack (com.github.PranavPurwar:kotlinc-android:2.4.0) for rapid integration into third-party Android apps and IDE plugins.

Dual JVM & Android Interop

Operates alongside javac-android to facilitate bidirectional Java-Kotlin joint compilation in mobile project trees.

Integration Example

// Gradle dependency configuration
repositories {
    maven { url 'https://jitpack.io' }
}

dependencies {
    implementation 'com.github.PranavPurwar:kotlinc-android:2.4.0'
}