compose-multiplatform
compose-multiplatform copied to clipboard
How can I develop compose-multiplatform projects using Intellij IDEA.
Describe the bug How can I develop compose-multiplatform projects using Intellij IDEA.
I use Intellij IDEA to open the project from Kotlin Multiplatform Wizard. Everything work well except the android app.
Affected platforms Select one of the platforms below:
- All
Versions
- Kotlin version*: 1.9
- Compose Multiplatform version*: 1.6
- OS version(s)* (required for Desktop and iOS issues): Windows 11
- OS architecture (x86 or arm64): x86
- JDK (for desktop issues): JDK 21
To Reproduce Download from Kotlin Multiplatform Wizard and open using IDEA.
Expected behavior Using IDEA to develop desktop, wasm and android projects.
Screenshots
looks like that the android app module is not detected.
no syntax highlight and no run configuration.
Hello, @Zeng1998! The problem may be that Android Plugin is disabled in your settings. Could you please check if it is enabled? Follow Settings -> Plugins (in the menu bar on the left side) -> Installed (right tab on the appeared screen).
Hello, @mazunin-v-jb , thanks your reply. I have made some retries and now there is something new.
I download a new project generated by https://kmp.jetbrains.com and open in IDEA directly. It contains Android, Desktop, and WASM.
Now, all modules are accurately detected. But there are still some that confuse me.
- For the desktop app, it's easy to run by just opening
main.ktand clicking the 'run button'.
- For the WASM app, I open
main.ktbut there is no 'run button'. Is this because IDEA has not yet supported this experimental feature? Of course, I can find the corresponding running command in Gradle.
- For the Android app, I open
MainActivity.ktand there is no 'run button' either. But I can find a run configuration named 'composeApp' in the IDEA.
Overall, I can run all the apps so far, but it still looks a bit complicated and may require a clearer understanding of the Gradle configuration files for me.