Build a target. Map the project.

Start with the desktop app for the shortest feedback loop, then connect the Gradle model to the folders you will read throughout this guide.

15–25 minutesJDK 21No KMP experience required

Before you start

Yokan is a Compose Multiplatform application targeting Android, desktop JVM, and iOS. You only need one runnable target to follow the guide.

ToolRequired forWhy
JDK 21All Gradle workRuns Gradle and the desktop target. Android bytecode is configured for JVM 17 separately.
Android SDKAndroidBuild tools, platform APIs, emulator, and APK packaging.
XcodeiOS on macOSCompiles the SwiftUI host and links the Kotlin/Native framework.
Composite build prerequisite

settings.gradle.kts includes ../yokan-ext. Keep the extension project beside this checkout, or replace that composite-build substitution with a resolvable published dependency before syncing Gradle.

Run your first target

Desktop has no emulator or Xcode handoff, so it is the best first proof that your JDK, Gradle, source sets, generated resources, and shared UI are wired correctly.

terminal · project root
export JAVA_HOME=$(/usr/libexec/java_home -v 21)   # macOS
./gradlew :composeApp:run

Once the desktop window opens, the same shared YokanApp() composition can be built for the other targets:

terminal · target checks
# Android debug APK
./gradlew :androidApp:assembleDebug

# Shared tests on the desktop JVM
./gradlew :composeApp:desktopTest

# iOS simulator framework
./gradlew :composeApp:linkDebugFrameworkIosSimulatorArm64

# Then run the native iOS host
open iosApp/iosApp.xcodeproj
Why desktop tests?

commonTest is compiled into platform test executables. The desktop JVM target is fast and can execute most shared domain, service, and state tests without a simulator.

Read the Gradle model

Open composeApp/build.gradle.kts and find kotlin { sourceSets { ... } }. The block defines a dependency graph, not independent folders.

Three source-set rules

  1. A child source set can use declarations and dependencies from every source set it dependsOn.
  2. commonMain cannot import Android, JVM, or Apple APIs. Its declarations must compile for every target.
  3. Intermediate source sets share capability between a subset of targets. Yokan uses this to avoid duplicating JVM engines and Android/iOS WebView code.

Tour the folders

Do not begin by reading every screen. First learn which layer owns each kind of decision.

composeApp/src/commonMain/kotlin/eu/friedcutlet/yokan ├── domain/ portable product models and recognition rules ├── database/ database contracts, entities, Room declarations ├── data/ repository boundary and domain/database mapping ├── services/ HTTP, extensions, sync, playback, platform contracts └── ui/ shared Compose app, state, screens, MVI, theme composeApp/src/{androidMain,desktopMain,iosMain} ├── database/ target-specific Room builders ├── services/ actual implementations and OS integrations └── ui/ small target rendering helpers iosApp/ native SwiftUI host for YokanShared.framework

The iOS host is intentionally small. Android and desktop also have thin entry points; the product is assembled in shared Kotlin.

Your first inspection

Trace the HTTP client factory. The shared service contract declares one capability; each target selects an engine:

commonMain/services/PlatformServices.kt
expect fun createPlatformHttpService(): HttpService
platform actuals
// androidMain + desktopMain
actual fun createPlatformHttpService(): HttpService =
    KtorHttpService(OkHttp.create())

// iosMain
actual fun createPlatformHttpService(): HttpService =
    KtorHttpService(Darwin.create())
  • Find the common expect declaration.
  • Open the Android, desktop, and iOS actual files.
  • Find the engine dependencies in their corresponding source sets.
  • Notice that callers depend on HttpService, not on OkHttp or Darwin.

Common setup problems

SymptomCheck
Unsupported Java versionConfirm java -version and JAVA_HOME both point to JDK 21.
Included build missingPlace yokan-ext beside this repository so ../yokan-ext resolves.
iOS framework not foundBuild the simulator framework, then let Xcode run BuildSharedFramework.sh from the host project.
Room generated code missingUse the Gradle tasks rather than compiling files directly; KSP runs once per configured target.