iosswiftrealitykit

Xcode 26 built app caused a crash on dyld when launching the app on iOS 17 due to a RealityKit API


I built my app using Xcode 26. I added some RealityKit logic but it's not used in iOS 17. I got this crash on launch:

dyld[576]: Symbol not found: _$s10RealityKit13ShapeResourceC14generateConvex4fromAcA04MeshD0C_tYaKFZ Referenced from: XXX /private/var/containers/Bundle/Application/XXX/XXX.app/Frameworks/XXX.framework/XXX Expected in: /System/Library/Frameworks/RealityFoundation.framework/RealityFoundation

My code:

return try! await ShapeResource.generateConvex(from: model.mesh)

This is strange because Xcode doesn't create compile error for iOS 17 - generateConvex has been available since iOS 13!

Then I tried guarding using if #available(iOS 18.0, *), it still crashes.

Then I tried wrapping it under a helper marked with @available(iOS 18.0, *), still crashes.


Solution

  • I have actually had this happen with several Apple frameworks in the last few versions and the only reliable way I have found to overcome it is to manually add the framework.

    Target > General > Frameworks

    enter image description here