iOS14 pod报错

升级iOS14以后发现项目报错了,提示

for “xxxxx” requires a development team. Select a development team in the Signing & Capabilities editor.”

有的第三方需要设置签名,遇到这种情况我们有以下四种解决办法

1.自己依次找到报错的第三方,自己设置签名和配置文件。这个不推荐,每次pod以后,都需要重新设置

2.设置自定义签名(根据当前的项目签名,自动配置第三方的签名)

这个方法比较推荐

在podfile文件的末尾加上

post_install do |installer|
  # Get main project development team id
  dev_team = ""
  project = installer.aggregate_targets[0].user_project
  project.targets.each do |target|
      target.build_configurations.each do |config|
          if dev_team.empty? and !config.build_settings['DEVELOPMENT_TEAM'].nil?
              dev_team = config.build_settings['DEVELOPMENT_TEAM']
          end
      end
  end

  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['DEVELOPMENT_TEAM'] = dev_team
        end
    end
  end
end

3.设置自定义签名(手动配置当前项目签名)

这个方法不灵活,不推荐,需要自己把teamId写上

在podfile文件的末尾加上

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

4.设置第三方不签名

这个方法从根源解决问题

在podfile文件的末尾加上

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

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值