在单个项目中使用 Swift Package Manager 和 CocoaPods 的问题

发布于 2025-01-17 20:19:29 字数 858 浏览 2 评论 0原文

我们决定将SPM用于我们的新内部框架。我们的应用程序(目前)在某些可可录中具有许多依赖关系。因此,我认为添加SPM非常容易。

我创建了一个本地的Swift软件包,并将其与该项目链接在一起。一切都很好,直到我将新软件包导入到swift文件中,

然后尝试在iOS模拟器上构建,我将面临以下编译器错误:

找不到Module'Corekit “针对目标” x86_64-Apple-ios-Simulator';

我能够构建到设备,没问题。只是不是模拟器。

我们面临类似的豆荚问题。这导致我们在podfile中添加以下内容

 installer_representation.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
    end
  end

,因为我们使用M1机器。

我已经尝试了以下操作:

  • 排除架构
  • 设置 仅构建Active Archives是是YAS/no
  • 添加添加x86_64 to 架构
  • ARM64中删除podfile的配置,

以开放有关我们如何解决此问题的任何建议。

谢谢

We've decided to use SPM for our new internal frameworks. Our app has many dependencies (for the moment) on some CocoaPods. So, I figured adding SPM would be easy enough.

I created a local Swift Package and linked it against the project. All good, until I import the new Package into a Swift file

Once I do that and try build on the iOS simulator, I am faced with the following compiler error:

could not find module 'CoreKit' for target 'x86_64-apple-ios-simulator';

I am able to build to a device, no problem. Just not the simulator.

We faced a similar issue for Pods; which resulted us adding the following in our Podfile

 installer_representation.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
    end
  end

We had to do this, since we use M1 Machines.

I have tried the following:

  • Removing arm64 from the Excluded Architectures
  • Setting Build Active Archives only to YES/NO
  • Adding x86_64 to Architectures
  • Removing the config for arm64 from the Podfile

Open to any suggestions on how we can resolve this.

Thanks

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文