So.... to force myself to not drop this project I am going to attempt to write my experiences while learning using Kotlin Multiplatform Mobile. My GitHub page is starting to become the place where ideas go to die ðŦ .
Disclaimer, this is my first ever attempt at documenting really anything but lets get into it.
My interest for KMM has stemmed from working with Xamarin Forms. The code sharing is amazing and I absolutely love C# but if you need to add any frills or flair to your UI, well, you better buckle up and start creating those custom renderers ð§.
Things that interested me about KMM:
1. Code sharing so you only have to write core code once.
2. Ability to use native cutting edge tech like Jetpack Compose and SwiftUI
3. You can quickly write native code if you need to get the job done. (Kotlin, Swift)
ð Here is my experience from 0 to setting up a new project:
TLDR: 8/10 experience. One minor issue while trying to run the iOS App which was quickly fixed searching stack overflow.
I pretty much followed the "Getting started" guide found here word for word.
Step 1: ðŧ Setting up my environment
Straight forward enough here, I had already had android studio installed (Electric Eel canary build) on my machine with the Kotlin plugins/language pretty much up to date.
I, however, had to install the Kotlin Multiplatform plugin for android studio.
Step 2: ðĶ Creating the Project
- After installing the KMM plugin for android studio I followed the prompts to create a new KMM app and had it created and loaded in a quick minute.
Step 3: ðĪ Running the Android app
- Easy as can be, waited for the Gradle sync and build to complete and just hit run in the upper right hand corner!
Step 4: ð Running the iOS App
- Now this one was a bit of a pain... When I first switched the configuration to "iosApp" I noticed a red X mark on the picture. After trying to run the app I was shown this error.
I had to do some googling but this stack overflow post
here helped to solve the issue.I closed Android studio and ran the following in my terminal and after that my simulator ran just fine.
cd ~/Library/LaunchAgents/
rm com.jetbrains.AppCode.BridgeService.plist
ðŽ Final thoughts:
All in all it was a pretty straight forward experience with iOS being the problem child like it usually is. It is probably less buggy to run the iOS app directly from Xcode but the fix was not too bad. After the fix I was up and running exploring the project structure and generated code.
Next time I would like to see if I can get something small to work like creating a shared view model. My ultimate goals for the project is to get Firebase Authentication working for both apps and get the app communicating to a Ktor Kotlin backend api for sending and receiving chat messages.
Thanks for reading ð and hopefully this does not join the project graveyard anytime soon ðŠĶ.
Top comments (0)