Can anyone suggest how we are supposed to create K...
# multiplatform
j
Can anyone suggest how we are supposed to create KMP projects? I’m an educator, and I’d like my students to be able to create Android+desktop applications (iOS is not a consideration). My preference would be to start them with a working project. This should be the simplest thing in the world, but I can’t create a clean project anymore: IntelliJ doesn’t have a project generator for this configuration, and Fleet doesn’t create projects. I’ve used the web generator, but selecting desktop+Android produces a project that: - IntelliJ doesn’t know how to use it properly (e.g. it recognizes Android but not desktop configuration). - Fleet shows invalid configurations for WASM and iOS (remember this is supposed to be just desktop+Android). Anyone have a suggestion? This is a terrible experience for new users.
j
Yes that’s the wizard that I’m using. I’ve used it before successfully but not in the past few days and not with this configuration.
m
Not sure if this is what you used when you said web generator. kdoctor might tell you why intellij doesn't like it.
j
kdoctor passes.
I appreciate the suggestion, but it simply isn’t working. I’m getting tired of uninstalling and reinstalling everything in a vain attempt to get it to work properly.
p
You have to install the KMP and desktop plugins in IntelliJ
Or use Android Studio, still need above plugins but no need to add the Android specific plugin
j
Which plugins? I’ve never seen a desktop plugin and I don’t believe there is a KMP plugin. Android Studio doesn’t recognize desktop either.
r
I've just tried creating a desktop+android project with this wizard and my Intellij recognizes desktop configuration but it doesn't recognize android (!). I'm not an android developer and I don't know what to do, so I would say it's indeed poor experience.
j
(My Android is broken too in this config but I thought it was my Android setup, lol).
a
j
@Pablichjenkov Thanks for the link! For some reason that doesn’t show up when I search plugins in Intellij.
I already have compose multiplatform installed.
p
Ahh ok. Can you post the specific error you are having.
j
Plugin doesn’t load in Intellij. Is this supported on Android Studio only?
At this point, I don’t even know if KMP projects are even supposed to be supported in IJ IDEA. Everything I’m seeing suggests that I probably should be using Fleet, but I don’t like the idea of unleashing a beta/changing IDE on students.
m
I was able to open the project from JetBrain's wizard using IntelliJ IDEA 2024.1.3 and everything seems to be working correctly.
p
Perhaps you are having a version mismatch, Jeff
j
Thanks @Michael Krussel. I’m repeating my steps now. I opened in IJ first, and desktop seems to work (no run config, but I can gradle run it). Maybe I messed up something by opening in Fleet first… licensing errors running Android but that might be separate.
👀 1
p
And it seems that it requires the Android plugin too
j
Yes thanks I have that installed already. I think it might have just been opening it in Fleet first that was causing issues, not really sure. Currently working out why I’m getting licensing errors for Android in IJ but at least I’m getting them in AS too! Thanks everyone, I think I’ll just learn my lesson and stick with IJ for now.
🎉 1
m
I do get the same licensing when I try to run. Not sure why since my other projects are using the same android versions.
Looks like it is looking for the licenses in the wrong directory
😆 1
j
Man, it really shouldn’t be this hard to get something working.
a
I'm wondering if the same issues will appear using Fleet 🤔
j
I just “fixed” the Android licensing error by opening Settings > Languages & Frameworks > Android SDK in IJ, then clicking Edit to check the location, selecting ok. Didn’t change anything, but this seemed to force a reload and then my project built. Maybe it’s just caching invalid license info somewhere and this refreshed it.
@Alejandro Rios I think I’ll avoid Fleet for a bit, at least for this project 🙂
👍 1
👍🏻 1
p
I did face similar stuff with Fleet , abandoned it like 6 months ago. Waiting for it to get better
j
Yeah that might have been my mistake too. I like the idea - I have students that try and use IJ with lightweight laptops so a lightweight IDE would be great for them, but probably not until its further along.
Thanks for the help everyone, I appreciate it!
👍 1