xcode15编辑完后的项目,在iOS12 跑不起来

背景:

更新Xcode15后,iphone6 和iphone6s 只要一启动就崩溃,错误信息如下:

Thread 1 Queue : com.apple.main-thread (serial)
#0	0x0000000000000000 in 0x00000000 ()
#1	0x0000000106fb5f98 in _GLOBAL__sub_I_SyntaxCommonConst.cpp ()
#2	0x000000010a44b2c4 in ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) ()
#3	0x000000010a44b6b0 in ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) ()
#4	0x000000010a4460f0 in ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) ()
#5	0x000000010a444520 in ImageLoader::processInitializers(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) ()
#6	0x000000010a4445e8 in ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) ()
#7	0x000000010a436658 in dyld::initializeMainExecutable() ()
#8	0x000000010a43aeb0 in dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) ()
#9	0x000000010a435208 in dyldbootstrap::start(dyld3::MachOLoaded const*, int, char const**, dyld3::MachOLoaded const*, unsigned long*) ()
#10	0x000000010a435038 in _dyld_start ()
Thread 2Thread 3com.apple.CoreMotion.MotionThread (4)

原因

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.

解决方法

就是在 build Setting 中的OTHER_LDFLAGS 添加这两个标识符:-Wl -ld_classic

参考链接

https://developer.apple.com/forums/thread/736203

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值