迁移到新版 Xcode 后出现错误
Resolve errors caused by migrating to a new Xcode version.
阅读时间2 分钟最后更新于 19 天前
症状
从旧版 Xcode 迁移到新版本后出现错误。以下是 UBA/Xcode 日志中表明存在此问题的常见错误消息和警告:- 编译器因符号未找到而失败:
-
ld: symbol(s) not found for architecture arm64clang: error: linker command failed with exit code 1 (use -v to see invocation)
-
- iOS 部署目标版本不受支持:
-
warning: The iOS deployment target 'IPHONEOSDEPLOYMENTTARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.1.99
-
- 签名需要未选中的开发团队:
-
error: Signing for "gRPC-C++-gRPCCertificates-Cpp" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'gRPC-C++-gRPCCertificates-Cpp' from project 'Pods')
-
原因
在更改 Xcode 版本时,如果某些组件、包或插件与新版本的 Xcode 不兼容,通常会出现这些错误。解决方案
首先,确保能够在批处理模式下使用代码仓库的全新克隆版本(无本地缓存库)进行本地构建,并且在构建 Xcode 项目时,除了在 Build Automation 目标中所做的更改之外,无需进行任何其他更改。 在批处理模式下成功进行本地构建后,确保本地使用的cocoapodscocoapodsgem install cocoapods -v 1.12.0echo "current cocoapods version: "gem which cocoapods

cocoapodspod --version
您可以将
cocoapodsDependencies.xml7.0.0~> 7.0