https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
k

Kavita

10/07/2020, 7:25 PM
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

Kris Wong

10/07/2020, 7:28 PM
see the iOS Application template under Run Configurations
k

Kavita

10/07/2020, 7:30 PM
Hi @Kris Wong, Yes, it is there but nothing happens after clicking on it
k

Kris Wong

10/07/2020, 7:32 PM
oh that's quite odd. something seems amiss with your KMM plugin
k

Kavita

10/07/2020, 7:33 PM
We need to install xcode for this, right?
k

Kris Wong

10/07/2020, 7:33 PM
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

louiscad

10/07/2020, 7:38 PM
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

Kavita

10/07/2020, 7:41 PM
I just have installed Xcode 11 but not
command line tools
.
l

louiscad

10/07/2020, 7:42 PM
Just open Xcode, it should take care of it before the welcome window appears.
👍 1
k

Kavita

10/07/2020, 7:43 PM
I just have created a new project & I am able to run it in xcode.
👍 1
l

louiscad

10/07/2020, 7:46 PM
Now, running it from Android Studio with KMM should works as well.
k

Kavita

10/07/2020, 7:48 PM
Still the same issue
l

louiscad

10/07/2020, 7:52 PM
Did you try clicking +?
k

Kavita

10/07/2020, 7:58 PM
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

louiscad

10/07/2020, 8:30 PM
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

Kavita

10/07/2020, 8:41 PM
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

Kris Wong

10/07/2020, 8:50 PM
I had this working with those versions ¯\_(ツ)_/¯
l

louiscad

10/07/2020, 8:59 PM
AS 4.0 is not really supported anymore from KMM 0.1.3 onwards.
k

Kavita

10/07/2020, 9:06 PM
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

louiscad

10/07/2020, 9:12 PM
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

Kavita

10/08/2020, 4:07 AM
Right, I can do that 👍
l

louiscad

10/08/2020, 1:14 PM
Then please do, I'd like to upvote it. Also, can you confirm it works on Xcode 11.3+ or Xcode 12.x?
k

Kavita

10/08/2020, 2:36 PM
@louiscad I have reported the issue: https://youtrack.jetbrains.com/issue/KT-42557
👍 1
🙏 1
k

Konstantin Tskhovrebov

10/10/2020, 4:50 PM
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

louiscad

10/10/2020, 5:28 PM
Ah yes, @Kavita, you probably need to update the Kotlin plugin, 1.4.0 is not the latest release.
k

Kavita

10/10/2020, 7:05 PM
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

Konstantin Tskhovrebov

10/10/2020, 7:16 PM
Check your
xcodeproj
property in
gradle.properties
file please
👍 1
k

Kavita

10/10/2020, 7:20 PM
@Konstantin Tskhovrebov it is
xcodeproj=./iosApp
k

Konstantin Tskhovrebov

10/10/2020, 7:23 PM
Maybe some errors in sync console during gradle sync?
k

Kavita

10/10/2020, 7:27 PM
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

louiscad

10/10/2020, 7:28 PM
@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

Kavita

10/10/2020, 7:31 PM
Yeah, I performed gradle sync. It worked without error
l

louiscad

10/10/2020, 7:35 PM
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

Kavita

10/10/2020, 7:37 PM
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

louiscad

10/10/2020, 8:00 PM
Another way is one of us sharing a project that works on our machine, freshly created from the wizard.
👍 1
k

Kavita

10/11/2020, 7:56 AM
When I build the project, I got this error:
l

louiscad

10/11/2020, 8:25 AM
Can you click on the root element in the run window to see all the logs?
k

Konstantin Tskhovrebov

10/11/2020, 10:20 AM
k

Kavita

10/11/2020, 10:37 AM
Awesome, this solution worked 🤩 . I applied the changes & restart the studio. Thanks @Konstantin Tskhovrebov & @louiscad for all the help 🙏
👍 2