升级Xcode14.3后的坑

第一个,不支持iOS11一下,所以引用的sdk需要更新iOS minimum deployment
可以直接修改,也可以在podfile里面加代码

第二个、pods中的resource bundles要指定team,可直接修改

上面两个问题可以直接在podfile里面加代码`

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
        config.build_settings['CODE_SIGN_IDENTITY']  = ''
        config.build_settings['ENABLE_BITCODE'] = 'NO'
      if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 11.0
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
      end
    end
  end
end

第三个、好不容易项目能成功运行了,能测试,却无法打包,报了一个莫名的错误,百度了一圈,也尝试了网上各种方法,还是archive failed

building file list ... rsync: link_stat "/Users/xxx/.../AFNetworking.framework" failed: No such file or directory (2)
done

sent 29 bytes  received 20 bytes  98.00 bytes/sec
total size is 0  speedup is 0.00
rsync error: some files could not be transferred (code 23) at /AppleInternal/Library/BuildRoots/9e200cfa-7d96-11ed-886f-a23c4f261b56/Library/Caches/com.apple.xbs/Sources/rsync/rsync/main.c(996) [sender=2.6.9]
Command PhaseScriptExecution failed with a nonzero exit code

搜索Xcode 14.3 Archive failure when running Cocoapods build script phase,可以看到CocoaPods已有issue在Xcode 14.3 beta时就有人发现了,结果Xcode 14.3正式版还是有问题。。。解决方案如下:

    找到...-frameworks.sh 文件,替换
    source="$(readlink "${source}")"
    为
    source="$(readlink -f "${source}")"
    最简单做法是:全局搜要替换的这段`source="$(readlink "${source}")"`,然后再把它替换为正确的`source="$(readlink -f "${source}")"`,再次编译即可成功。

升级Xcode14.3后的坑_第1张图片

再次archrive,没问题啦!祝顺利

你可能感兴趣的:(iOS,Xcode,Mac,xcode,ios,macos)