Xcode 15 相关问题修复方案总结(含 Creator 2.x, 3.x)

随着近期 Xcode 15 正式版的发布,有些开发者升级到此 XCode 版本后,发现「编译报错」或者「启动崩溃」的相关问题。以下为相关问题的解决方案。

Creator 3.x

低于 3.8.1 的版本,请手动合并此补丁:https://github.com/cocos/cocos-engine/pull/16306

Screenshot 2023-09-28 at 10.32.04

此补丁已合并进 3.8.1 中

Creator 2.x

在 Xcode 的配置中添加 -ld_classic 链接参数,具体设置路径为:Build Settings -> Linking - General -> Other Link Flags

由于 2.x 并没有使用 CMake ,我们暂时没有找到根据 Xcode 版本配置 Other Link Flags 的方式,因此 2.x 的用户需要先手动修改工程配置的方式绕过「启动崩溃」的问题。

17赞

标记一下。mark :blush:
遇到ios崩溃问题最蛋疼

mark mark mark

战略mark

mark下

正好遇到问题,新版本啥时候发布?

mark一下

cocos2dx 3.17.2 版本呢,怎么处理 xcode15的升级

参考文章中 creator 2.x 的解决方案。

弱弱问一句,mac的native/CmakLists.txt在哪改 :rofl:,window的就找得到

mark, Mac directory

/Applications/Cocos/Creator/3.8.1/CocosCreator.app/Contents/Resources/resources/3d/engine/native

mark, 谢谢

悲剧了,用的2.4.5版本,项目或者脚本修改后重新构建项目在Xcode中必报错,不管是完全构建还是只构建脚本,每次修改后只能把全部项目删除然后重新构建才能正常运行测试,这个要怎么破啊,求救

如果是因为每次构建引发的问题, 就可以试试将ios工程独立出去,修改ios工程使用的构建资源路径,

降级 xcode,用 xcode 15 以下的版本。

过一阵估计低于15构建出的包就不让提了

这是 xcode 15 的已知问题,如果 xcode 要做这种限制,那么他肯定要解决自己的已知问题啊。

https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#Linking

Linking
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.

Weak symbol imports are linked as non-weak imports, when used from LTO object files. (115521975) (FB13171424)

Workaround: Add -Wl,-weak_reference_mismatches,weak or -Wl,-ld_classic options to the OTHER_LDFLAGS build setting.

在 xcode 15.1 中修复了

https://developer.apple.com/documentation/xcode-release-notes/xcode-15_1-release-notes

Linking
Resolved Issues
Fixed: 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)

Fixed: Weak symbol imports are linked as non-weak imports, when used from LTO object files. (115521975) (FB13171424)


1赞