简体   繁体   English

使用 Xcode 13 构建项目时出现“编译 swift 源文件 (arm64)”错误

[英]Error 'compile swift source files (arm64)' when building project with Xcode 13

NOTE: I know that there are many answers related to these questions, but I've tried each of them, and when I am not able to resolve it with those, I am posting question here.注意:我知道有很多与这些问题相关的答案,但我已经尝试了每一个,当我无法解决这些问题时,我会在这里发布问题。 Hence, I request you not to mark it as a duplicate.因此,我要求您不要将其标记为重复。

I am developing an app with Xcode 13.0 (13A233) on Macbook with an M1 chip.我正在使用 M1 芯片的 Macbook 上使用 Xcode 13.0 (13A233) 开发应用程序。 After updating pods to the latest version, the pods are complaining about error将 pod 更新到最新版本后,pod 抱怨错误

CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'Alamofire' from project 'Pods') CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler(在项目'Pods'的目标'Alamofire'中)

and not building for either real devices or simulators.而不是为真实设备或模拟器构建。

I'm including the following pods in the project:我在项目中包含以下 pod:

  • Alamofire阿拉莫菲尔
  • IQKeyboardManager IQKeyboardManager
  • NVActivityIndicatorView NVActivityIndi​​catorView
  • FillableLoaders可填充加载器
  • SQlite.Swift SQLite.Swift
  • SDWebImage SDWebImage
  • SwiftDataTables SwiftDataTables

I've already applied the following solutions for the main project and all pods projects:我已经为主项目和所有 pod 项目应用了以下解决方案:

  • Upon updating pods, clean build folder (using Shift + Command + K)更新 pod 后,清理构建文件夹(使用 Shift + Command + K)
  • Excluding arm64 architecture for 'Any iOS Simulator SDK' from Excluded architectures从排除的架构中排除“任何 iOS 模拟器 SDK”的 arm64 架构
  • Set 'YES' to 'Build Active Architecture Only'将“是”设置为“仅构建活动架构”
  • There is no field called 'VALID_ARCHS' in the User-Defined section用户定义部分中没有名为“VALID_ARCHS”的字段
  • Solution provided over Medium 通过介质提供的解决方案

You can see Error details on this screenshot.您可以在此屏幕截图中查看错误详细信息

Any quick response with a proper solution will be much appreciated.任何具有适当解决方案的快速响应将不胜感激。 Thank you!谢谢!

Remaining solution剩余溶液

1.Remove any architecture related run script from your project of Project target 1.从项目目标的项目中删除任何与架构相关的运行脚本

2.Uninstall and install pods 2.卸载和安装pods

Same issue.同样的问题。

CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'lottie-ios' from project 'Pods') export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk CompileSwiftSources 普通 arm64 com.apple.xcode.tools.swift.compiler(在项目“Pods”的目标“lottie-ios”中)导出 DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer export SDKROOT=/Applications/Xcode.app /Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk

Personally solved it by doing all you mentioned and also switching to new build system.通过执行您提到的所有操作并切换到新的构建系统,亲自解决了这个问题。 Xcode => File => Workspace settings... Xcode => 文件 => 工作区设置...

There change the build system to "New Build System".将构建系统更改为“新构建系统”。

工作区设置屏幕截图

Finally, I was able to figure out the issue, and it was related to the version of the pod that was being used in code.最后,我能够找出问题所在,这与代码中使用的 pod 的版本有关。

So, If you're still experiencing the same, I recommend to:因此,如果您仍然遇到相同的情况,我建议您:

  • Check the compatibility of the pod which is causing issue检查导致问题的 pod 的兼容性
  • Uninstall and install pods again卸载并重新安装 pod

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在构建 Unity 项目后修复 Xcode 中的“Undefined symbols for architecture arm64:”错误? - How to fix the “Undefined symbols for architecture arm64:” error in Xcode after building a Unity project? 使用 Objective-C 框架构建 Swift 项目时出现“架构 arm64 的未定义符号”错误 - Getting “Undefined symbol for architecture arm64” error while building Swift project with Objective-C framework xcode5构建ios arm64静态库,构建程序集文件时出错 - xcode5 build ios arm64 static library, error when building the assembly file Swift 编译错误 - 架构 arm64 的未定义符号 - Swift Compile Error - Undefined symbols for architecture arm64 构建libetpan项目期间ARM64构建错误 - ARM64 build error during building libetpan project 适用于arm64 iPhone的Xcode 5编译失败 - xcode 5 compile for arm64 iPhone failed Xcode 13 构建失败,“入口点 (_main) 未定义。对于体系结构 arm64” - Xcode 13 failing building with "entry point (_main) undefined. for architecture arm64" 错误:在iOS项目(swift)中嵌入Unity(Vuforia)时,体系结构arm64的符号未定义 - Error: Undefined symbols for architecture arm64 when Embed Unity(Vuforia) in IOS project(swift) xcode 6.x arm64代码生成失败,没有任何编译或链接错误 - xcode 6.x arm64 code build failed without any compile or link error 在模拟器上编译 Xcode 12.2 中的 cordova 代码时,MFP 出现 arm64 错误 - While compile on simulator the cordova code in Xcode 12.2 with MFP getting error for arm64
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM