XCode14 requires a development t
2022-09-21 本文已影响0人
iOS_修心
Xcode升级到14后,编译报错:
Signing for "xxx" requires a development team. select a development team in the signing & capabilities editor
该错误为Pod库中包含Test的Target,需要设置Team ID
项目中错误样式
59009968-7ebb2d00-87e4-11e9-9fe1-281086efc69c.pngPods库中错误样式
59010057-d6f22f00-87e4-11e9-8461-1c2a97a4baf0.png修复方式
第一种:手动修改的报错Pods的库
59010058-d6f22f00-87e4-11e9-8bde-2d7bdc7bc21d.png第二种:Podfile 中添加团队ID
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
# Fix bundle targets' 'Signing Certificate' to 'Sign to Run Locally'
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
第三种:针对Bundle类型的做强制不签名。 可能会上线错误:ITMS-90284,必须使用配置文件中包含的证书进行签名。
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