对于那些不想添加开发团队 ID 的人,可以按照以下步骤操作:
1- 打开 Podfile 文件
2- 添加以下内容
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
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
end
3- 运行Pod安装
4- 运行您的项目
flutter run
运行到我的设备上。我花费了很多很多小时来解决这个问题,并支付了苹果开发者账户的费用来尝试修复它(似乎通过Xcode运行但不是flutter run)。我对Podfiles不是很熟悉,我认为它是在说“如果在物理设备上运行,则不要签名”?这会对发布后产生任何后果吗? - DecafCoder我在升级到XCode 14后遇到了这个问题,错误出现在我的Flutter项目中。
我已经将以下代码添加到我的Podfile
的post-install脚本中以禁用代码签名。
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
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
end