Swift Package:
I have an old objc library, that is added as XCFramework to swift package as a binary target.
targets: [ .target( name: "CoreServices", dependencies: ["OldContainer"], path: "CoreServices" ), .binaryTarget( name: "OldContainer", path: "Frameworks/OldContainer.xcframework" ), ]
This serves the purpose, it builds fine and able to run on simulator. However this framework is breaking the Xcode previews.
Error:
== PREVIEW UPDATE ERROR: [Remote] JITError: Runtime linking failure Additional Link Time Errors: Symbols not found: [ _OBJC_CLASS_$_SCSecureServicesFactory ] ================================== | [Remote] LLVMError | | LLVMError: LLVMError(description: "Failed to materialize symbols: { (static-Login, { __replacement_tag$1015 }) }") == VERSION INFO: Tools: 16C5032a OS: 23G93 PID: 38675 Model: MacBook Pro Arch: arm64e == ENVIRONMENT: openFiles = [ /Users/../Documents/GitHub/Packages/Login/Sources/Login/LoginView.swift ] wantsNewBuildSystem = true newBuildSystemAvailable = true activeScheme = Launch activeRunDestination = iPhone 16 Pro Max variant iphonesimulator arm64 workspaceArena = [x] buildArena = [x] buildableEntries = [ Login Login ] runMode = JIT Executor == SELECTED RUN DESTINATION: Simulator - iOS 18.2 | iphonesimulator | arm64 | iPhone 16 Pro Max | no proxy == EXECUTION MODE OVERRIDES: Workspace JIT mode user setting: true Falling back to Dynamic Replacement: false
Based on the error, SCSecureServicesFactory
is an objc file inside the XCFramework. Since this is a binary target, I could not add a swift setting module map flag to the XCFramework.
Is there any workaround to get the previews working ? Or Am I blocked until the library is converted into swift ?