I want to try out the Kotlin Multiplatform Mobile (KMM) in Android studio. I have installed the Plugin and when I try to add configuration for IOS, nothing shows up. I just have an IOS option but nothing shows up when I click on it. The android device is already set up, so I was able to run it in Android.
I guess you are not running Android Studio on macOS. You must have macOS to compile through XCode and use Apple Simulators.
If you are running AS on macOS and you created the project with KMM plugin it's weird that you don't have the run configuration for iOS already set up, but you can try to click on the +
button on the upper-left corner. Remember that you must have XCode (and Simulators) and command line tools installed on your machine.
If you are running AS on an OS different from macOS you can only compile the non native (not macOS or iOS) part of the library.
Had the same issue. What fixed it it for me was installing Xcode command line tools with xcode-select --install
.
If that doesn't work, generally check the integrity of your Xcode setup.
You need following to run your KMP app from android studio on ios device
- Mac
- Android Studio IDE
- Install kdoctor tool
- Xcode IDE
- Cocapods
- Install Kotlin Multiplatform Mobile (plugin)
After all these steps do the rest as follow
- Go to Edit Configuration.
- Click on (+) Icon on top Left to Add New Configuration.
- You will find iOS Application configuration in the list choose it.
- Then you need to fill the following details.
As you can see for 1st field you need to choose iosApp.xcodeproj and you will find it under your created project directory open it there you will find iosApp folder inside it you can find iosApp.xcodeproj file choose it in the 1st field and for rest of field select as show in screenshot. Apply -> OK
There you go you will have iosApp configuration.
I encountered this error after I had updated my macOS to the latest version (Sequoia 15.0.1 (24A348) as of this date)
What worked for me:
- Update android studio to the latest version (Ladybug | 2024.2.1 Patch 1 as of this date)
- Update xcode to the latest version (Version 16.0 (16A242d) as of this date)
- Update kdoctor (not significant)
Hope this helps someone
© 2022 - 2024 — McMap. All rights reserved.