Kavita

    Kavita

    1 year ago
    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?
    Kris Wong

    Kris Wong

    1 year ago
    see the iOS Application template under Run Configurations
    Kavita

    Kavita

    1 year ago
    Hi @Kris Wong, Yes, it is there but nothing happens after clicking on it
    Kris Wong

    Kris Wong

    1 year ago
    oh that's quite odd. something seems amiss with your KMM plugin
    Kavita

    Kavita

    1 year ago
    We need to install xcode for this, right?
    Kris Wong

    Kris Wong

    1 year ago
    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
    louiscad

    louiscad

    1 year ago
    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.
    Kavita

    Kavita

    1 year ago
    I just have installed Xcode 11 but not
    command line tools
    .
    louiscad

    louiscad

    1 year ago
    Just open Xcode, it should take care of it before the welcome window appears.
    Kavita

    Kavita

    1 year ago
    I just have created a new project & I am able to run it in xcode.
    louiscad

    louiscad

    1 year ago
    Now, running it from Android Studio with KMM should works as well.
    Kavita

    Kavita

    1 year ago
    Still the same issue
    louiscad

    louiscad

    1 year ago
    Did you try clicking +?
    Kavita

    Kavita

    1 year ago
    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?
    louiscad

    louiscad

    1 year ago
    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
    Kavita

    Kavita

    1 year ago
    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
    Kris Wong

    Kris Wong

    1 year ago
    I had this working with those versions ¯_(ツ)_/¯
    louiscad

    louiscad

    1 year ago
    AS 4.0 is not really supported anymore from KMM 0.1.3 onwards.
    Kavita

    Kavita

    1 year ago
    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 🙂
    louiscad

    louiscad

    1 year ago
    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.
    Kavita

    Kavita

    1 year ago
    Right, I can do that 👍
    louiscad

    louiscad

    1 year ago
    Then please do, I'd like to upvote it. Also, can you confirm it works on Xcode 11.3+ or Xcode 12.x?
    Kavita

    Kavita

    1 year ago
    Hello @here, I am not able to configure the template for iOS Application in my Kotlin Multiplatform project. I have all below plugins installed: Android Studio: 4.1 RC 3, Kotlin: 1.4.0-release-Studio4.1-1 Kotlin Multiplatform: 0.1.3-release-54-Studio4.1 Xcode: 11.3 Xcode Command Line Tool: 11.3 How to run the iOS app in Kotlin Multiplatform project? Did I miss anything?
    Konstantin Tskhovrebov

    Konstantin Tskhovrebov

    1 year ago
    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
    louiscad

    louiscad

    1 year ago
    Ah yes, @Kavita, you probably need to update the Kotlin plugin, 1.4.0 is not the latest release.
    Kavita

    Kavita

    1 year ago
    Thanks, @Konstantin Tskhovrebov & @louiscad for the reply. But it is still not working. I update the Kotlin plugin & created the new project. Still not able to run iOS application 😞 , whereas the android app is working fine. Below are the plugin and studio versions currently I am using. Also, I have updated my Xcode & Xcode command line tool to 11.5.
    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.
    Konstantin Tskhovrebov

    Konstantin Tskhovrebov

    1 year ago
    Check your
    xcodeproj
    property in
    gradle.properties
    file please
    Kavita

    Kavita

    1 year ago
    @Konstantin Tskhovrebov it is
    xcodeproj=./iosApp
    Konstantin Tskhovrebov

    Konstantin Tskhovrebov

    1 year ago
    Maybe some errors in sync console during gradle sync?
    Kavita

    Kavita

    1 year ago
    No, it worked smoothly. No error in an event log, just these 2 warnings:
    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.
    louiscad

    louiscad

    1 year ago
    @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)
    Kavita

    Kavita

    1 year ago
    Yeah, I performed gradle sync. It worked without error
    louiscad

    louiscad

    1 year ago
    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.
    Kavita

    Kavita

    1 year ago
    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.
    louiscad

    louiscad

    1 year ago
    Another way is one of us sharing a project that works on our machine, freshly created from the wizard.
    Kavita

    Kavita

    1 year ago
    When I build the project, I got this error:
    louiscad

    louiscad

    1 year ago
    Can you click on the root element in the run window to see all the logs?
    Konstantin Tskhovrebov

    Konstantin Tskhovrebov

    1 year ago
    Kavita

    Kavita

    1 year ago
    Awesome, this solution worked 🤩 . I applied the changes & restart the studio. Thanks @Konstantin Tskhovrebov & @louiscad for all the help 🙏