用xcode 15打包出来的项目在iOS 12 的系统上启动就崩溃,并且是在进入appdelegate 之前的编译阶段就崩溃了
1、Build Settings -> Other Linker Flags -> Add -> -ld64
其中“-ld64”可以有三个值“-Wl、-ld_classic、-ld64” 理论上必要设置 “-ld64”即可
附上官方社区复兴:
“New Features
A new linker has been written to significantly speed up static linking. It’s the default for all macOS, iOS, tvOS and visionOS binaries and anyone using the “Mergeable Libraries” feature. The classic linker can still be explicitly requested using -ld64, and will be removed in a future release.
(108915312)
Known Issues
Binaries using symbols with a weak definition crash at runtime on iOS 14/macOS 12 or older. This impacts primarily C++ projects due to their extensive use of weak symbols. (114813650) (FB13097713)
Workaround: Bump the minimum deployment target to iOS 15, macOS 12, watchOS 8 or tvOS 15, or add -Wl,-ld_classic to the OTHER_LDFLAGS build setting.”
2、当这个时间设置之后,当debug 环境可以正常时间,切换到release 环境会继承崩溃,虽然报错是汇编代码,但是很明显是和之前的不一样
必要处理:Build Settings ->Asset Catalog Compiler-> Generate Swift Asset Symbol Framework Support,把SwiftUI去掉,(iOS 12 是还不支持 swiftUI 的,当时的UI框架应该是UIKit 和storyboard)
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。 |