为 iOS 模拟器构建的 XCode 12.3,但在为 iOS 构建的 dylib、架构 arm64 的 couchbaselite 框架中链接使用 M1 芯片组

问题描述

在 IOS 上也遇到了一个构建问题,“为 iOS 模拟器构建,但在为 iOS 构建的 dylib 中链接文件 '.../platforms/ios/Pods/CouchbaseLite/iOS/CouchbaseLite.framework/CouchbaseLite' 用于架构 arm64 "

我目前使用 nativescript 6.5.3 和 cocoapod 1.10。 使用 M1 芯片组。

解决方法

  1. 转到TARGET(例如我屏幕中的Runner,而不是PROJECT),然后构建设置
  2. 在屏幕截图中搜索 excluded
  3. 编辑 Architectures > Excluded Architectures 中的字段,以添加 arm64。您可以双击第一行来编辑下面的所有 3 行。
  4. 重建/运行

Screenshot of IDE showing architectures section which contains exluded architectures subsection,which as Debug,Profile,Release subsections. Edit all of them to contain arm64

我的详细信息:在 M1 mac mini 上运行,带有一个 Flutter iOS 项目。