Hello everyone, I just have started exploring Kotl...
# multiplatform
k
Hello everyone, I just have started exploring Kotlin multiplatform and created the Hello World! project. I can run the Android project on emulator but I don't see the option to run the iOS app. Even iOS simulator option is also not visible. I must have missed something. How to run the iOS app in Kotlin Multiplatform project? Can someone please help me to solve this query?
k
see the iOS Application template under Run Configurations
k
Hi @Kris Wong, Yes, it is there but nothing happens after clicking on it
k
oh that's quite odd. something seems amiss with your KMM plugin
k
We need to install xcode for this, right?
k
maybe try removing it and re-adding it, and restarting android studio
yes you have to have Xcode & command line tools installed to work with iOS apps
πŸ‘ 1
l
Could be worth filing an issue on kotl.in/issue to have KMM warn noticeably for iOS run configurations when Xcode and its command line tools are not installed.
k
I just have installed Xcode 11 but not
command line tools
.
l
Just open Xcode, it should take care of it before the welcome window appears.
πŸ‘ 1
k
I just have created a new project & I am able to run it in xcode.
πŸ‘ 1
l
Now, running it from Android Studio with KMM should works as well.
k
Still the same issue
l
Did you try clicking +?
k
Yeah @louiscad, tried that as well. Seems not able to add the template
Is it because I had installed Multiplatform plugin first and then xcode?
l
I'd first try to just restart the IDE. BTW, are you using Android 4.1+? If not, please try with 4.1 or 4.2
k
I tried by reinstalling Multiplatform plugin & restart the studio. Didn't work :( Below are the versions: Android Studio version: 4.0.1 Kotlin plugin version: 1.4.10-release-Studio4.0-1 Multiplatform: 0.1.3-release-54-Studio4.0
k
I had this working with those versions Β―\_(ツ)_/Β―
l
AS 4.0 is not really supported anymore from KMM 0.1.3 onwards.
k
You are right, seems I need to update studio & xcode as well. I had installed xcode11, as per the documentation it supports 11.3+
Thanks a lot @louiscad & @Kris Wong for the quick help πŸ™‚
πŸ™‚ 1
l
Can you report the fact that KMM didn't warn you about all that on kotl.in/issue and give us the link? That'll be helpful for others in the future.
❀️ 1
k
Right, I can do that πŸ‘
l
Then please do, I'd like to upvote it. Also, can you confirm it works on Xcode 11.3+ or Xcode 12.x?
k
@louiscad I have reported the issue: https://youtrack.jetbrains.com/issue/KT-42557
πŸ‘ 1
πŸ™ 1
k
https://plugins.jetbrains.com/plugin/14936-kotlin-multiplatform-mobile/versions/stable/98571 This version requires Kotlin Plugin: 1.4.10-release-1-Studio4.1-1
l
Ah yes, @Kavita, you probably need to update the Kotlin plugin, 1.4.0 is not the latest release.
k
Could you please provide me the details of Studio & plugin versions, which u are using in the Multiplatform project? I can try similar versions, maybe that will help.
k
Check your
xcodeproj
property in
gradle.properties
file please
πŸ‘ 1
k
@Konstantin Tskhovrebov it is
xcodeproj=./iosApp
k
Maybe some errors in sync console during gradle sync?
k
No, it worked smoothly. No error in an event log, just these 2 warnings:
Copy code
12:38 AM	Plugin Update Recommended: Android Gradle Plugin is ready to update.

12:38 AM	Plugin Update Recommended: Android Gradle Plugin is ready to update.
l
@Kavita Can you try the "Build" tool window?
Also, can you ensure you performed a Gradle sync first? (The elephant + tilted arrow icon in the toolbar)
πŸ‘ 1
k
Yeah, I performed gradle sync. It worked without error
l
The project doesn't include private code yet, right? If so, I think it could be zipped and sent to @Konstantin Tskhovrebov so he can check if the culprit lies in the project or in your machine config.
k
Yeah, this will be really helpful as I have spent 2-3 days on installing and trying multiple plugin versions. It is the default
Hello world
project. I can share it.
l
Another way is one of us sharing a project that works on our machine, freshly created from the wizard.
πŸ‘ 1
k
When I build the project, I got this error:
l
Can you click on the root element in the run window to see all the logs?
k
k
Awesome, this solution worked 🀩 . I applied the changes & restart the studio. Thanks @Konstantin Tskhovrebov & @louiscad for all the help πŸ™
πŸ‘ 2