Android Integration
Skotch can produce unsigned Android APKs containing DEX bytecode and a
generated binary AndroidManifest.xml. No Android SDK, Gradle, or d8
is required.
Project setup
Section titled “Project setup”myapp/ build.gradle.kts src/main/kotlin/ Main.ktbuild.gradle.kts
Section titled “build.gradle.kts”plugins { id("com.android.application") kotlin("android")}
android { namespace = "com.example.myapp" compileSdk = 34
defaultConfig { applicationId = "com.example.myapp" minSdk = 24 targetSdk = 34 versionCode = 1 versionName = "1.0" }}Building
Section titled “Building”skotch buildOutput: build/app-unsigned.apk
The APK contains:
| File | Source |
|---|---|
AndroidManifest.xml | Generated from the android { } config (binary AXML format) |
classes.dex | Compiled from src/main/kotlin/ sources |
APK signing
Section titled “APK signing”Skotch supports APK Signature Scheme v2 with PEM key files. Add a signing config to your build file:
android { signingConfigs { debug { storeFile = "keys/debug-key.pem" storePassword = "" keyAlias = "debug" keyPassword = "" } }}Configuration defaults
Section titled “Configuration defaults”If not specified in build.gradle.kts:
| Property | Default |
|---|---|
minSdk | 24 |
targetSdk | 34 |
compileSdk | 34 |
Current limitations
Section titled “Current limitations”| Feature | Status |
|---|---|
Android resource processing (res/) | Not supported |
Source AndroidManifest.xml parsing | Manifest generated from build config only |
| Android SDK APIs | Not available (no classpath/dependency support) |
| Activity, Fragment, View classes | Blocked on class support |
| ECDSA / Ed25519 signing | Only RSA supported |
| PKCS#12 keystores | Not yet — use PEM |
resources.arsc generation | Not yet — only included if already present |
| ProGuard / R8 shrinking | Not supported |
| AAB (Android App Bundle) | Not supported |
Single-file DEX compilation
Section titled “Single-file DEX compilation”For experiments, you can compile a single .kt file to DEX directly:
skotch emit --target dex hello.kt -o classes.dexVerify the output with Android SDK tools if available:
dexdump -d classes.dex