获取“选定方案“iosApp”不支持“iphone模拟器”” Kotlin 多平台错误

发布于 2025-01-18 15:26:53 字数 667 浏览 5 评论 0原文

我正在尝试运行 由 Android Studio 中的 Kotlin 多平台移动插件生成的初始示例应用。我按照这些步骤进行环境设置。 Android模拟器运行正常,但iPhone模拟器无法运行。运行配置出现以下错误:

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

当我运行配置(忽略错误)时,iPhone 模拟器确实会打开并且似乎会加载 iOS,但它永远不会加载 Android Studio 中的“Hello,iOS”应用程序。

什么会导致这种情况呢?

版本信息:

  • macOS 12.2.1
  • Android Studio 2021.1.1 补丁 2
  • Xcode 13.3

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

一场信仰旅途 2025-01-25 15:26:53

我用以下方法修复了它。

  • 请关闭Android Studio。
  • 转到〜/Library/launchagents/文件夹和Delete com.jetbrains.appcode.bridgeservice.plist那里。
  • 再次使用KMM插件启动Android Studio。它应该现在起作用。

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.
甜妞爱困 2025-01-25 15:26:53

从我的测试来看,我们收到此错误的原因似乎有多种:

  • ios 项目的根文件夹的名称与 .xcodeproject 文件的名称不同。有时,即使它们不同,它也能工作,如果我们在框架已经连接到 iOS 项目后更改这个名称,也许会很重要。
  • “其他链接器标志”是手动复制的,并且不是使用 将框架连接到您的 iOS 项目。这会导致错误的数据,例如:
   "$(inherited)", 
   "-framework", 
   "shared\n",

而不是

    "$(inherited)",
    "-framework",
    shared,

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", 
   "shared\n",

instead of

    "$(inherited)",
    "-framework",
    shared,
蓝礼 2025-01-25 15:26:53

我通过在Android Studio上进入编辑配置,并再次选择我的Xcode Project文件的位置来解决此问题。我相信这是Android Studio中KMM插件的错误,尚未修复。

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.

蓝海似她心 2025-01-25 15:26:53

更新 Android Studio 和 KMM 插件对我有用。

Updating Android Studio and KMM plugin worked for me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文