iOS 升级到XCode14后适配iOS16
1、解决xcode14 运行报错运行遇到的报错 “error: Signing for “XX” requires a development team.
在podfile文件中添加如下内容 设置User-Defined CODE_SIGNING_ALLOWED = NO
post_install do |installer|
installer.pods_project.targets.each do |target|
# 解决xcode14 运行报错运行遇到的报错 “error: Signing for “XX” requires a development team.”
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
https://github.com/CocoaPods/CocoaPods/issues/11402#issuecomment-1201464693
2、解决XCode14打包ipa在iOS12.2以下设备闪退的问题
dyld: Library not loaded: /usr/lib/swift/libswiftCoreGraphics.dylib
解决办法:Build Setting ->Other Link Flags下添加-Wl,-weak-lswiftCoreGraphics
如果项目有使用Cocoapods,运行时哪个三方库报这个错,就找到这个报错的库,同样在Build Setting ->Other Link Flags路径下添加这个-Wl,-weak-lswiftCoreGraphics,比如我pods下的JXPageControl这个报错了,就对这个做配置,有几个库报错就添加几个
如果不想手动添加也可以在podfile中添加如下文件自动添加-Wl,-weak-lswiftCoreGraphics
need_otherlinkerflags_frameworks = ['Charts','JXPageControl']
post_install do |installer|
installer.pods_project.targets.each do |target|
# 解决XCode14打包ipa在iOS12.2以下设备闪退的问题
target.build_configurations.each do |config|
if need_otherlinkerflags_frameworks.include?(target.name)
config.build_settings['OTHER_LDFLAGS'] = '-Wl,-weak-lswiftCoreGraphics'
end
end
end
end
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 因为Apifox不支持离线,我果断选择了Apipost!
· 通过 API 将Deepseek响应流式内容输出到前端