This quickstart assumes you’re starting with an existing Compose Multiplatform project. If you’re creating a new project from scratch, follow the Kotlin Multiplatform quickstart and select the desktop target.
Prerequisites
Before you begin, ensure your project meets these requirements:- Kotlin 2.1.20 or higher
- Compose Multiplatform 1.8.2 or higher
- JVM target configured in your multiplatform project
- IntelliJ IDEA 2025.2.2+ or Android Studio Otter 2025.2.1+ (recommended)
Setup
Add the plugin to your version catalog
In
gradle/libs.versions.toml, add the Compose Hot Reload plugin:gradle/libs.versions.toml
Apply the plugin to your parent project
In your parent project’s
build.gradle.kts, add the plugin to prevent it from being loaded multiple times:build.gradle.kts
Enable hot reload in your app module
In your application module’s
build.gradle.kts, apply the plugin:app/build.gradle.kts
Configure JetBrains Runtime (optional)
For automatic JetBrains Runtime provisioning, add the Foojay resolver to
settings.gradle.kts:settings.gradle.kts
If you run hot reload from IntelliJ IDEA or Android Studio with the Kotlin Multiplatform plugin, the IDE’s JetBrains Runtime will be used automatically.
Create Your First Hot Reload App
Let’s create a simple counter app to demonstrate hot reload functionality.Run with hot reload
- IDE
- Command Line
- Click the Run icon in the gutter next to your
main()function - Select Run ‘jvm’ with Compose Hot Reload
- Your application will launch with hot reload enabled
Try hot reload
With your app running, make a change to see hot reload in action:
- Click the button a few times to increment the counter
- Open
App.ktand change the button text from"Increment"to"Count Up" - Save the file (Cmd+S / Ctrl+S)
- The button text updates instantly while preserving your counter value!
Understanding Hot vs Cold State
Compose Hot Reload preserves different types of state differently:Reload Modes
Explicit Mode
Default behaviorTrigger reloads manually:
- Press the keyboard shortcut (configurable in IDE settings)
- Click the Reload UI button in the floating toolbar
- Run the
reloadGradle task
Auto Mode
Continuous reloadEnable with the Changes reload automatically when you save files.
--autoReload or --auto flag:Next Steps
Installation Guide
Learn about advanced configuration and JetBrains Runtime provisioning
View Sample Project
Explore the complete counter sample with hot state management
Troubleshooting
Hot reload task not found
Hot reload task not found
Make sure you’ve:
- Applied the plugin to your application module
- Synced Gradle after adding the plugin
- Configured a JVM target in your multiplatform setup
Changes not applying
Changes not applying
- Verify you’ve saved the file (Cmd+S / Ctrl+S)
- Check that you’re editing the correct source set (jvmMain)
- For auto mode, ensure you started with the
--autoReloadflag
JetBrains Runtime not found
JetBrains Runtime not found
- Install the Kotlin Multiplatform IDE plugin (will use IDE’s JBR)
- Or add the Foojay resolver plugin to
settings.gradle.kts - Or enable experimental auto-provisioning with
compose.reload.jbr.autoProvisioningEnabled