Xcode 14签名问题

升级Xcode 14版本后,打包报错,提示签名相关问题。

1、对于cocoapods管理的三方库,设置不签名即可,podfile中,添加下述代码:
`post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)

Add the line below

target_is_resource_bundle = target.respond_to?(:product_type) && target.product_type == 'com.apple.product-type.bundle'

target.build_configurations.each do |config|

  # And lines from here
  if target_is_resource_bundle
    config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
    config.build_settings['CODE_SIGNING_REQUIRED'] = 'NO'
    config.build_settings['CODE_SIGNING_IDENTITY'] = '-'
    config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = '-'
  end
  # to here

end

end
end`

2、Flutter混编的项目,由于flutter clean命令会清理掉.ios文件中profile,flutter pub get 会自动生成.ios文件,写在profile中不可取。

flutter模块以framework形式引入iOS原生工程,用命令生成framework时,加上--no-codesign参数,即:
flutter build ios --release --no-codesign
打包出来,取出相应的framework。

cocoapods形式引入flutter模块,flutter build ios-framework --cocoapods 中没有不签名的参数,打包一直失败。
这种形式只能设计Flutter SDK至最新版本,我升级到stable 3.3.9版本,打包是正常的。
生成framework命令:
flutter build ios-framework --cocoapods --output=文件路径 --verbose

posted @ 2022-11-29 16:10  JustToGo  阅读(594)  评论(0编辑  收藏  举报