skip to Main Content

I am trying to run the initial example apps generated by the Kotlin Multi Platform Mobile plugin in Android Studio. I followed these steps for my environment setup. The Android Simulator runs correctly, but the iPhone Simulator does not. The Run Configuration has the following error:

Error: Selected scheme "iosApp" does not support "iphonesimulator"

When I run the configuration (ignoring the error), the iPhone simulator does open and appears to load iOS, but it never loads the "Hello, iOS" application that is in Android Studio.

What would cause this?

Version Information:

  • macOS 12.2.1
  • Android Studio 2021.1.1 Patch 2
  • Xcode 13.3

4

Answers


  1. I fixed it with the following method.

    • Please close the Android Studio.
    • Go to ~/Library/LaunchAgents/ folder and delete com.jetbrains.AppCode.BridgeService.plist there.
    • Launch Android Studio with the KMM plugin again. It should work now.
    Login or Signup to reply.
  2. From my tests, it seems that there may be multiple reasons for which we receive this error:

    • the root folder of the ios project has a different name than the .xcodeproject file. Sometimes it works even if they are different and maybe it matters if we change this name after the frameworks was already connected to the iOS project.
    • "Other linker flags" were manually copied and they were not copied using the copy button from the Connect the framework to your iOS project. This results to wrong data like:
       "$(inherited)", 
       "-framework", 
       "sharedn",
    

    instead of

        "$(inherited)",
        "-framework",
        shared,
    
    Login or Signup to reply.
  3. I managed to fix this by going into Edit Configurations on Android Studio and choosing the location of my XCode project file again. I believe this is an error of the KMM plugin in Android Studio and has yet to be fixed.

    Login or Signup to reply.
  4. Updating Android Studio and KMM plugin worked for me.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search