美文网首页
Xcode14 pod 签名报错的解决方案

Xcode14 pod 签名报错的解决方案

作者: 大宝来巡山 | 来源:发表于2023-02-05 17:03 被阅读0次

背景:

在使用Xcode14进行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

相关文章

网友评论

      本文标题:Xcode14 pod 签名报错的解决方案

      本文链接:https://www.haomeiwen.com/subject/ndczhdtx.html