Closed natanfudge closed 1 week ago
Supporting live edit for Multiplatform is tracked here - https://github.com/JetBrains/compose-multiplatform/issues/2063, closing this as duplicate
For issues with Android Studio tooling, please use appropriate Google issue tracker.
@MatkovIvan can we get an official comment on #2036?
Describe the bug In a Compose MP project, while running on an Android device, live editing Android source set code is possible. However, if you edit in a multiplatform (
common
) source set, an internal compiler error occurs.Affected platforms Android Versions
2.0.0
Android
To Reproduce Steps to reproduce the behavior:
Open any Compose multiplatform app that supports Android
Make absolutely sure to have this in your
android {}
block in the app module'sbuild.gradle
(The example multiplatform Compose app doesn't do this):Launch Android app in an integrated emulator , use Android Studio to get the below error. The IntelliJ IDEA Android plugin simply says "Test sources not supported: filexyz.kt"
Edit some Compose code in the
commonMain
source setObserve "Out Of Date" error:
Here it is as text:
Expected behavior Edited code is live edited into the Android device
Current workaround - recommended for any and all users of Jetbrains Compose, even if they don't even target Android:
android {
block incomposeApp/build.gradle.kts
:common
code intoandroidMain
.java.*
and most Kotlin reflection)androidMain
code intocommon
, and resolve any platform specific errors (usually <1% of the work).