I’ve just spent some time on a second attempt of using KMP and Compose.
Naturally, I went through the documentation mentioned here:
Here are the things that confused me in this process:
- I planned and expected to use IDEA Ultimate as the IDE - for one thing, it mentions KMP in the “new project” modal. However, I had some trouble with it and the documentation seems to always recommend using Android Studio.
- Switching to Android Studio solved many problems and after some fidgeting, I got the app to build and run on a simulator (on Windows). However, browsing the project, a lot of things come up about multiplatform and android, but not much about ios (for example the root
build.gradle.kts
as well ascomposeApp/build.gradle.kts
contains an entire “android” section). This is very confusing because it gives the impression that something is wrong/missing. - I wrote some platform-specific code. The android part compiles fine, the iOS part doesn’t (“Unresolved reference: platform”).
- After some digging, I find that in order to make it work on ios, you actually need to have XCode running (which in turn requires osx).
This seems to be a silly limitation to a certain point. In the end, I’d use some sort of CI process to actually build platform-specific apps.
In conclusion:
- would be nice to mention limitations and requirements somewhere
- it’s still not clear to me how the project should be managed - is it correct that I would need to switch between Android Studio and XCode (and possibly IDEA Ultimate), or is there a way to use just one IDE?
- still don’t know where to start with ios, or if I can somehow skip the current problem (I can’t compile the rest of the project)
- the interface to the build system could be greatly improved if gradle was dropped - I’ve said it in the past, it’s one of the worst piece of software I’ve ever seen, and wrapping it in kotlin only seems to make kotlin dirtier.
- at this point, it feels that “multiplatform” isn’t very true - considering that you need 3rd-party and platform-specific tools (and code?).