Skip to content
skotch
...

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.

myapp/
build.gradle.kts
src/main/kotlin/
Main.kt
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"
}
}
Terminal window
skotch build

Output: build/app-unsigned.apk

The APK contains:

FileSource
AndroidManifest.xmlGenerated from the android { } config (binary AXML format)
classes.dexCompiled from src/main/kotlin/ sources

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 = ""
}
}
}

If not specified in build.gradle.kts:

PropertyDefault
minSdk24
targetSdk34
compileSdk34
FeatureStatus
Android resource processing (res/)Not supported
Source AndroidManifest.xml parsingManifest generated from build config only
Android SDK APIsNot available (no classpath/dependency support)
Activity, Fragment, View classesBlocked on class support
ECDSA / Ed25519 signingOnly RSA supported
PKCS#12 keystoresNot yet — use PEM
resources.arsc generationNot yet — only included if already present
ProGuard / R8 shrinkingNot supported
AAB (Android App Bundle)Not supported

For experiments, you can compile a single .kt file to DEX directly:

Terminal window
skotch emit --target dex hello.kt -o classes.dex

Verify the output with Android SDK tools if available:

Terminal window
dexdump -d classes.dex