Skip to content


Wolf-Martell Montwé edited this page Jun 20, 2023 · 51 revisions

How to build K-9 Mail


K-9 Mail targets Java 11. New code is written in Kotlin. The current development version of K-9 Mail runs on Android 5.0 (API level 21) and newer versions.


Install the following via the Android SDK Manager:

  • Android SDK Build-tools 34.0.3
  • SDK Platform 33

Building with Android Studio

If you want to modify K-9 Mail we highly recommend using Android Studio.

Use the "Import project" functionality of Android Studio to start the import wizard. Then select the directory into which you cloned the K-9 Mail repository. The rest should happen automatically.

Building with Gradle on the command line

To be able to build K-9 Mail on the command line, you need the Java Development Kit (JDK) version 17 installed. We recommend to use Temurin by Adoptium. On most Linux distributions temurin-17-jdk can be installed via the package manager. For all other platforms try Temurin installation guide.

To create a debug build on Unix-based systems use the command:

./gradlew assembleDebug

On Windows open the command prompt and enter the command:

gradlew.bat assembleDebug

Check/fix code style

We use ktlint to enforce code style rules for Kotlin code. To check for code style violations use the command:

./gradlew spotlessCheck

To automatically fix most code style violations use the command:

./gradlew spotlessApply

Running tests

To run the tests use the command:

./gradlew testDebugUnitTest