Hey here, I had started building a compose multipl...
# multiplatform
s
Hey here, I had started building a compose multiplatform app targeting Android & iOS, then decided to try compose hot reload to see if it'd save me time refreshing the app. After setting it up, and making changes in commonMain (most of my code live here) the changes don't seem to appear on the desktop app automatically or immediately. Am I missing something or its only changes to jvmMain that'd appear immediately on the desktop app?
It appears I had to click the Reload button for changes to be reflected
z
Changes in
commonMain
are supported too, that's not the issue. How are you running the app? The easiest way is to have the KMP plugin installed in your IDE and then run the app with hot reload from the gutter icon. This way the IDE triggers reloads on code changes.
And whichever way you're running it, you should see a log message in the outputs that tells you what mode hot reload is in and how to reload.
s
How are you running the app?
Hmm what's the gutter icon? I am running it via the standard way with the hot reload option.
z
The "gutter icon" is the little play icon next to the line number, so you got it πŸ‘ It should perform a reload when you make changes and save the file.
Can you share what your IDE version is and what's in the logs at startup about hot reload?
s
IDE: Android Studio Otter 2 Feature Drop | 2025.2.2 Canary 3
Copy code
07:33:06: Executing 'hotRunJvm --mainClass "com.simi.shelfpal.MainKt"'…

Executing tasks: [hotRunJvm, --mainClass, com.simi.shelfpal.MainKt] in project /Users/simileoluwaaluko/AndroidStudioProjects/ShelfPal/composeApp

  ________________________________________________________________________________________________
| 
| Compose Hot Reload (1.0.0)
| Running 'com.simi.shelfpal.MainKt'
| JetBrains Runtime: /Applications/Android <http://Studio.app/Contents/jbr/Contents/Home/bin/java|Studio.app/Contents/jbr/Contents/Home/bin/java>
| ________________________________________________________________________________________________
| Explicit Reload Mode:
| Use `./gradlew reload` to hot reload the application
| Use `./gradlew :composeApp:hotReloadJvmMain` to hot reload the application (alternative)
| Use `./gradlew :composeApp:hotRunJvm --auto` to automatically reload the application on source changes
| ________________________________________________________________________________________________
πŸ”₯ | DevTools | Info  | Running 'Gradle'...
πŸ”₯ | Build    | Info  | Starting a Gradle Daemon, 1 busy and 1 stopped Daemons could not be reused, use --status for details
πŸ”₯ | Build    | Info  | Reusing configuration cache.
πŸ”₯ | App      | Info  | Resolved 'dirty' @Composable scopes within 1.460125ms
πŸ”₯ | App      | Info  |   ~ No @Composable is dirty
πŸ”₯ | Build    | Info  | 
πŸ”₯ | Build    | Info  | BUILD SUCCESSFUL in 4s
πŸ”₯ | Build    | Info  | 13 actionable tasks: 2 executed, 11 up-to-date
πŸ”₯ | Build    | Info  | Configuration cache entry reused.
πŸ”₯ | DevTools | Info  | Running 'Gradle'...
πŸ”₯ | Build    | Info  | Reusing configuration cache.
πŸ”₯ | App      | Info  | Resolved 'dirty' @Composable scopes within 44.833us
πŸ”₯ | App      | Info  |   ~ No @Composable is dirty
πŸ”₯ | Build    | Info  | 
πŸ”₯ | Build    | Info  | BUILD SUCCESSFUL in 769ms
πŸ”₯ | Build    | Info  | 13 actionable tasks: 2 executed, 11 up-to-date
πŸ”₯ | Build    | Info  | Configuration cache entry reused.
I guess I can see the problem now lol. I didn't add the auto flag to the configuration?
Screenshot 2025-11-25 at 07.36.43.png
Yep. Tested. that was it. Thanks!
z
--auto
is one way, it'll do Gradle continuous builds with its file watching to trigger reloads. But in explicit mode, the IDE should be reloading on saves as well. I'll look into it, thanks for the version info!
s
No probs. Do you mean when I use the play icon ▢️ with hot reload πŸ”₯ it should automatically reload without any added config ?
πŸ‘Œ 1
z
Just tried it on a fresh install with that Canary and it works on my machine ℒ️ I tried these AS versions, with a fresh project: Android Studio Otter 2 Feature Drop | 2025.2.2 RC 2 Android Studio Otter 3 Feature Drop | 2025.2.3 Canary 2
It should show this hint when the app is launched (at least the first time)
And you can also go into settings and look for Hot Reload to see when the IDE will reload
(These should work in explicit mode, without
--auto
)
s
I see. I could restart AS to see if it'd work as expected when I get back to my machine. The difference here is that the project didn't target Desktop from the start. I just added the gradle file changes for desktop and manually created the jvmMain directory to test hot reload.
z
That should also not be a problem! You can always test a fresh project for a sanity check as well, but if you have the Hot Reload plugin you should be all set config-wise.
❀️ 1