Signing for "xxx" requires a development team. select a development team in the signing & capabilities editor

问题

使用 Xcode 14 pod install 编译后报错,Signing for "xxx" requires a development team. select a development team in the signing & capabilities editor

解决方案

  • 方法一:手动选择Pod工程中的Bundle target 签名中的Team,与主工程一致,每次pod install 的时候都需要重新选择一次,不推荐。
  • 方法二:在 Podfile 脚本中设置 Team ID 如下
post_install do |installer|
installer.generated_projects.each do |project|
project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings["DEVELOPMENT_TEAM"] = "Team ID (不是 Team Name)"
end
end
end
end

如果上述两种都不行,设置CODE_SIGN_IDENTIFY为空,如下

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['CODE_SIGN_IDENTITY'] = ''
end
end
end

参考链接:

https://morganwang.cn/2022/09/14/Xcode14%E7%BC%96%E8%AF%91%E5%A4%B1%E8%B4%A5%E4%BF%AE%E6%94%B9/

https://github.com/CocoaPods/CocoaPods/issues/11402