Xcode 16 – Symbol not found: ShapeResource generateConvex

Hi,

I have a RealityKit app that I am building with Xcode 16. The app has a minimum deployment target of iOS 17. If I run it on an iOS 17 device the app crashes:

dyld[15716]: Symbol not found: _$s10RealityKit13ShapeResourceC14generateConvex4fromAcA04MeshD0C_tYaKFZ
  Referenced from: …
  Expected in: …/System/Library/Frameworks/RealityFoundation.framework/RealityFoundation

My code looks something like this:

@available(iOS, introduced: 13.0, obsoleted: 18.0)
@MainActor @preconcurrency func generateNonAsyncConvexShapeResource(from meshResource: MeshResource) throws -> ShapeResource {
    ShapeResource.generateConvex(from: meshResource)
}

@available(iOS 18.0, *)
func generateConvexShapeAsync(from meshResource: MeshResource) async throws -> ShapeResource {
    // This will only be available for iOS 18 and above
    return try await ShapeResource.generateConvex(from: meshResource)
}

if let meshResource = try? modelEntity.model?.mesh.applying(transform: transform.matrix) {
    if #available(visionOS 1.0, iOS 18.0, *) {
        try? await generateConvexShapeAsync(from: meshResource)//  await shapeResources.append(.generateConvex(from: meshResource))
    } else {
        try? generateNonAsyncConvexShapeResource(from: meshResource)
    }
}

So I actually do check for the system and only call the async variant on iOS 18. Any hints how to fix that?

Thanks!

Answered by DTS Engineer in 803138022

Hello @arthurfromberlin,

Please file a bug report for this issue using Feedback Assistant.

Best regards,

Greg

Accepted Answer

Nevermind, solved it by setting Other Linker Flags → -weak_framework RealityFoundation

Hello @arthurfromberlin,

Please file a bug report for this issue using Feedback Assistant.

Best regards,

Greg

Xcode 16 – Symbol not found: ShapeResource generateConvex
 
 
Q