Xcode 14 pod 签名报错的解决方案

本文介绍在Xcode14环境下使用CocoaPods安装依赖时遇到的编译错误,提供了两种解决方案来避免因缺少团队标识而导致的错误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

背景:

在使用Xcode 14进行pod install 后,库里有bundle资源文件则会在编译时报错,报error:“igning for “xxxxx” requires a development team. Select a development team in the Signing & Capabilities editor.”

解决方案:

方案一:
给报错的pod库逐个设置bundle identifier和team

缺点:每次执行pod install之后我们的配置就会消失,需要再次手动设置一遍

方案二:

在Podfile中添加以下配置,添加后再重新pod update即可

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"] = " Your Team ID  "
         end
    end
  end
end

若不想设置具体的team ID可尝试下面的配置:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
      target.build_configurations.each do |config|
          config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
      end
    end
  end
end

以上方案来源于:https://github.com/CocoaPods/CocoaPods/issues/11402

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值