Xcode 14 需要为 Pod Bundles 选择开发团队

dom*_*mfz 97 xcode ios swift

XCode 图像指示由于缺乏所需的开发团队而出现错误

由于没有选定的开发团队,这两个项目都不会使用 Xcode 14 beta 进行构建。两次都是带有蓝色乐高图标的目标(我想是捆绑包?)

似乎在早期版本的 Xcode 中,团队也没有设置,但它并没有导致构建错误。

在这里选择自己的开发团队会不会是错误的?

dom*_*mfz 121

podfile 中的这个post_install脚本修复了它。看来组建自己的开发团队是有必要的。将您的团队 ID 替换为您项目的 TeamID。

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
Run Code Online (Sandbox Code Playgroud)

  • 您还可以放置 config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'`,我更喜欢这样做,因为我为每个应用程序使用多个团队 ID。 (47认同)
  • 这只是一个解决方法,而不是修复。事实上,您可能有多个具有不同团队 ID 的目标。 (4认同)
  • 只是说这对我有用,并且没有破坏使用 Xcode 13 构建的任何内容 (2认同)
  • 参考https://github.com/CocoaPods/CocoaPods/issues/11402 (2认同)
  • Cocoapods 1.12.0 现在添加了“CODE_SIGNING_ALLOWED = 'NO'”,无需修改 Podfile。 (2认同)

小智 105

我更喜欢下面的代码,这样您就不需要签署每个单独的包,并且当您使用多个签名团队时这很容易。

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
Run Code Online (Sandbox Code Playgroud)


Sh_*_*han 18

如果有人需要知道 PodFile 的正确结构

# Uncomment the next line to define a global platform for your project
# platform :ios, '12.0'


target 'APPTarget' do
    # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
    use_frameworks!
       
    # Your packages goes here

end
 
# Disable signing for pods
post_install do |installer|
  installer.generated_projects.each do |project|
    project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
         end
    end
  end
end
Run Code Online (Sandbox Code Playgroud)