Some Macs recently received a macOS system update which disabled the simulator runtimes used by Xcode 15, including the simulators for iOS, tvOS, watchOS, and visionOS. If your Mac received this update, you will receive the following error message and will be unable to use the simulator:
The com.apple.CoreSimulator.SimRuntime.iOS-17-2 simulator runtime is not available.
Domain: com.apple.CoreSimulator.SimError
Code: 401
Failure Reason: runtime profile not found using "System" match policy
Recovery Suggestion: Download the com.apple.CoreSimulator.SimRuntime.iOS-17-2 simulator runtime from the Xcode
To resume using the simulator, please reboot your Mac. After rebooting, check Xcode Preferences → Platforms to ensure that the simulator runtime you would like to use is still installed. If it is missing, use the Get button to download it again.
The Xcode 15.3 Release Notes are also updated with this information.
Xcode
RSS for tagBuild, test, and submit your app using Xcode, Apple's integrated development environment.
Posts under Xcode tag
200 Posts
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I'm unable to sign the an example application using xcode and "automatically manage signing".
The error I'm getting is:
CodeSign [...] (in target 'foobar' from project 'foobar')
Signing Identity: "Apple Development: [xxxx] "
/usr/bin/codesign --force --sign 4ABB258102FF656E9F597546A49274C28D2B8B3E -o runtime --timestamp\=none --generate-entitlement-der [filename]
4ABB258102FF656E9F597546A49274C28D2B8B3E: no identity found
Command CodeSign failed with a nonzero exit code
However, I am able to see a certificate and a private identity on my keychain:
% security find-certificate -aZ | grep -i 4ABB258102FF656E9F597546A49274C28D2B8B3E
SHA-1 hash: 4ABB258102FF656E9F597546A49274C28D2B8B3E
and
% security find-key -s | grep -q 'Apple Development' && echo YES
YES
what is puzzling is that security does not find an identity:
% security find-identity -p codesigning
Policy: Code Signing
Matching identities
0 identities found
Valid identities only
0 valid identities found
but XCode claims that everything is working fine.
Anybody knows what might I be missing?
I tried logging out, requesting new certificates, rebooting, moving them to another keychain, and asking to developer friends.
My Xcode crashed over and over again while I searing spefic file like "TingMusic". I have tried uninstall and install Xcode from 16.0 to 16.4, clear derived data folder, reboot my Mac, but none of these working. 😭
Translated Report (Full Report Below)
Process: Xcode [1811]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 16.4 (23792)
Build Info: IDEApplication-23792000000000000~2 (16F6)
App Item ID: 497799835
App External ID: 874973124
Code Type: ARM-64 (Native)
Parent Process: launchd [1]
User ID: 501
Date/Time: 2025-09-02 10:51:26.8582 +0800
OS Version: macOS 15.6 (24G84)
Report Version: 12
Anonymous UUID: 9835064A-AD7C-EE47-64DE-49587A7EC956
Time Awake Since Boot: 320 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Reason: Namespace SIGNAL, Code 6 Abort trap: 6
Terminating Process: Xcode [1811]
Application Specific Information:
abort() called
Application Specific Signatures:
isSameDocumentAsURL
Kernel Triage:
VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x186d5e388 __pthread_kill + 8
1 libsystem_pthread.dylib 0x186d9788c pthread_kill + 296
2 libsystem_c.dylib 0x186ca0a3c abort + 124
3 IDEKit 0x10890d888 +[IDEAssertionHandler _handleAssertionWithLogString:assertionSignature:assertionReason:extraBacktrace:] + 964
4 IDEKit 0x10890dcf8 -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] + 872
5 DVTFoundation 0x1047839a0 _DVTAssertionHandler + 412
6 DVTFoundation 0x104783b04 _DVTAssertionFailureHandler + 196
7 IDEKit 0x1086e5178 -[IDENavigableItemCoordinator _navigableItemForFilePath:inWorkspace:withSeenFileReferences:computedNavItemsByContainerFilePath:allowLeaf:] + 2240
8 IDEKit 0x1086e3d24 -[IDENavigableItemCoordinator _structureNavigableItemForFileURL:inWorkspace:error:] + 268
9 IDEKit 0x1086e4658 -[IDENavigableItemCoordinator structureNavigableItemForDocumentURL:inWorkspace:error:] + 152
10 IDEKit 0x1086e89bc +[IDENavigableItemCoordinator temporaryStructureItemForDocumentURL:forWorkspace:error:inScope:] + 116
11 IDEKit 0x1088689e0 +[IDEOpenQuicklySubpathGenerator subpathForURL:lineNumber:isFromProject:showFileName:fromWorkspace:withAttributes:] + 716
12 IDEKit 0x108869a88 -[IDEOpenQuicklyResult(SubPath) subPathForWorkspace:withAttributes:] + 356
13 IDEKit 0x1088eee54 -[IDEOpenQuicklyResultDisplayRecord subtitle] + 172
14 IDEKit 0x10894bb1c -[IDEOpenQuicklyResult(ViewExtension) cellViewForOutlineView:displayRecord:delegate:] + 596
15 IDEKit 0x108849564 -[IDEQuickSearchWindowController outlineView:viewForTableColumn:item:] + 72
16 AppKit 0x18ae314a8 -[NSTableView(NSTableViewViewBased) makeViewForTableColumn:row:] + 176
17 AppKit 0x18ae30c0c -[NSTableRowData _addViewToRowView:atColumn:row:] + 228
18 AppKit 0x18ae2ed5c -[NSTableRowData _initializeRowView:atRow:] + 328
19 AppKit 0x18ae2d8ec -[NSTableRowData _preparedRowViewForRow:storageHandler:] + 140
20 AppKit 0x18ae2d7bc -[NSTableRowData _addRowViewForVisibleRow:withPriorView:] + 268
21 AppKit 0x18ae2d5e4 -[NSTableRowData _addRowViewForVisibleRow:] + 316
22 AppKit 0x18ae2cdf0 -[NSTableRowData _updateVisibleRowEntries] + 640
23 AppKit 0x18ae2c854 -[NSTableRowData updateVisibleRowViews] + 612
24 AppKit 0x18ae2bf08 -[NSTableView layout] + 148
25 AppKit 0x18b8d0fa8 ___NSViewLayout_block_invoke + 632
26 AppKit 0x18ade7000 NSPerformVisuallyAtomicChange + 108
27 AppKit 0x18adeb8d8 _NSViewLayout + 96
28 AppKit 0x18b8c72cc __36-[NSView _layoutSubtreeWithOldSize:]_block_invoke + 372
29 AppKit 0x18ade7000 NSPerformVisuallyAtomicChange + 108
30 AppKit 0x18adeb86c -[NSView _layoutSubtreeWithOldSize:] + 100
31 AppKit 0x18b8c7410 __36-[NSView _layoutSubtreeWithOldSize:]_block_invoke + 696
32 AppKit 0x18ade7000 NSPerformVisuallyAtomicChange + 108
33 AppKit 0x18adeb86c -[NSView _layoutSubtreeWithOldSize:] + 100
34 AppKit 0x18b8c7410 __36-[NSView _layoutSubtreeWithOldSize:]_block_invoke + 696
35 AppKit 0x18ade7000 NSPerformVisuallyAtomicChange + 108
36 AppKit 0x18adeb86c -[NSView _layoutSubtreeWithOldSize:] + 100
37 AppKit 0x18b8c7410 __36-[NSView _layoutSubtreeWithOldSize:]_block_invoke + 696
38 AppKit 0x18ade7000 NSPerformVisuallyAtomicChange + 108
39 AppKit 0x18adeb86c -[NSView _layoutSubtreeWithOldSize:] + 100
40 AppKit 0x18b8c7410 __36-[NSView _layoutSubtreeWithOldSize:]_block_invoke + 696
41 AppKit 0x18ade7000 NSPerformVisuallyAtomicChange + 108
42 AppKit 0x18adeb86c -[NSView _layoutSubtreeWithOldSize:] + 100
43 AppKit 0x18b8c7410 __36-[NSView _layoutSubtreeWithOldSize:]_block_invoke + 696
Hi everyone,
I am trying to generate an .ipa file for my .NET MAUI (net9.0-ios) application, but every attempt fails with the same codesigning error. I have tried multiple approaches, including building from Windows paired to macOS, and directly building through the macOS terminal, but nothing is working.
Below are the exact steps I followed:
Steps I Performed
Generated the Apple Development certificate using Keychain Access on macOS.
Added that certificate into my developer account and created the corresponding provisioning profile.
Created an App ID, attached the App ID to the provisioning profile, and downloaded it.
Added the provisioning profile into Xcode.
Verified that the certificate is correctly visible in Keychain Access (private key available).
Attempted to build/publish the MAUI app to generate the .ipa file.
Issue
Whenever I run the publish command or build via Windows/macOS, codesigning fails with the following error:
/usr/bin/codesign exited with code 1:
Frameworks/libSkiaSharp.framework: replacing existing signature
Warning: unable to build chain to self-signed root for signer "Apple Development: Created via API (8388XAA3RT)"
Frameworks/libSkiaSharp.framework: errSecInternalComponent
Failed to codesign 'PCS_EmpApp.app/Frameworks/libSkiaSharp.framework':
Warning: unable to build chain to self-signed root for signer "Apple Development: Created via API (8388XAA3RT)"
PCS_EmpApp.app: errSecInternalComponent
Build eventually fails with:
Build failed with 4 error(s) and 509 warning(s)
Environment
.NET: 9.0
MAUI: latest tools
Xcode: 26.0.1
macOS: 26.0.1
Building for ios-arm64 (device)
What I suspect
It looks like the signer certificate might not be trusted, or the certificate chain cannot connect to an Apple root CA. But the certificate was created using the Developer website and appears valid.
Need Help With
Why is codesign unable to build the certificate chain?
Do I need a different type of certificate? (App Store / Distribution vs Development?)
Is there any special configuration required for MAUI apps using native frameworks like libSkiaSharp.framework?
How can I successfully generate the .ipa file?
Any guidance will be greatly appreciated. Thank you!
When I try to validate my app I get the following error:
Invalid bundle. Because your app supports Multitasking on iPad, you need to include the LaunchScreen.storyboard launch storyboard file in your com.augmentedReality.virtualTags bundle. Use UlLaunchScreen instead if the app's MinimumOSVersion is 14 or higher and you prefer to configure the launch screen without storyboards. For details, see: https:// developer.apple.com/documentation/bundleresources/information_property_list/
uilaunchstoryboardname (ID: 236f630a-a014-48e8-910a-77d9c0ff6f51)
What should I do to fix it?
In the previous Xcode version and on another app it did not appear.
MacBook Pro M5, Tahow 26.1, Xcode 26.1.1
Currently Xcode has iOS simulators that allow easily testing apps on older versions of iOS. It would be helpful if there was also a macOS simulator for testing apps on older versions of macOS.
FB21229682
https://github.com/feedback-assistant/reports/issues/724
Hello,
We are experiencing a persistent issue where macOS builds in Xcode Cloud consistently hang at the Archive stage.
The build itself completes successfully, but no artifacts appear, and it seems the build gets stuck during artifact upload. These builds remain in this state for several days (currently 3 days and counting) not failing, but never finishing.
We opened a support ticket (102756662562), but we have not received any response yet.
We rely on Xcode Cloud for our entire CI/CD pipeline, and at the moment our workflow is completely blocked because of this issue.
Has anyone encountered something similar or found a workaround?
Thank you.
The Test target not build for not such file or directory: 'CoreGraphics'.
Not sure why I get this error, but I configured the target without forgetting the variables BUNDLE_LOADER with $(BUILT_PRODUCTS_DIR)/MyExistingApp.app/MyExistingApp value and TEST_HOST with $(BUNDLE_LOADER) value.
App target (not the test target), the Symbols Hidden by Default build setting its equal to NO, unlike the Test target that is set to YES.
Any variable more for this? I'm not sure if I should take anything into account when using Xcode 26.1.1 and Swift Testing framework.
I have been using Xcode Version 26.1.1 on macOS Tahoe Version 26.1. In VIM mode, whenever I quickly tap d twice, to delete the complete line, most of the time Xcode crashes. Is anyone else facing this issue? Should I move to any older version of Xcode or any other solve for this?
I am using Automatically Manage Signing
And I have registered my Mac UUID in developer account, but it is still giving me these errors -
Device My Mac is not registered to your team Ai Glider Inc. Devices must be registered in order to run your code, but you do not have permission to register them. Please check with your team's admin.
No profiles for 'com.aiexample.sebexample' were found
Xcode couldn't find any Mac App Development provisioning profiles matching 'com.aiexample.sebexample'.
In Xcode's (version 16.1) "Devices and Simulators" window pressing the device's context menu item "Show Provisioning Profiles..." does nothing: no new window, no message, nothing. How can I fix this?
Topic:
Code Signing
SubTopic:
Certificates, Identifiers & Profiles
Tags:
iOS
Xcode
Provisioning Profiles
I'm using Xcode Cloud to build for internal TestFlight testing.
But it stuck in Archive. No warning or error. Unable to complete the workflow.
What could be causing this? I have absolutely no idea what to do now.
Hello everyone,
I'm currently developing an iOS application and have a question regarding project architecture changes and App Store Connect submissions.
My app is already uploaded to App Store Connect and is being used for internal testing via TestFlight. During development, I've realized my initial project architecture is flawed and unsustainable.
The Problem and Proposed Solution
I've decided the best approach is to completely redevelop the app from scratch using a new, clean Xcode project that implements a better architecture (e.g., MVVM, Clean Architecture).
The Core Question
If I create a brand new Xcode project for the redeveloped app, can I:
Use the same Bundle Identifier (com.mycompany.myapp) in the new project?
Successfully archive and upload the build from this new Xcode project to the existing app on App Store Connect?
In essence, does App Store Connect require the new build to originate from the same Xcode project structure as the previous builds, or does it only validate the Bundle Identifier and Version/Build Number?
Any advice or confirmation from developers who have gone through a similar complete project overhaul would be greatly appreciated.
Thank you!
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
Bundle ID
App Store Connect
Xcode
I want to create a dynamic library for my iOS project, which would be loaded at runtime.
In Xcode, there are templates available for creating a static/dynamic lib for MacOS. But under the iOS tab, there is only a "static library" template.
So, I used the "static library" template and in its build settings I changed the Mach-O type to "dynamic library".
Now after building it, I use the file command on the generated file and it tells me it is a dynamic lib.
But the generated file still has .a extension, which is usually for static libs.
I'm aware we can tell Xcode in build settings to change the .a extension to something else, say .dylib but this seems like a hacky way to create a dynamic library.
What is the correct way?
I am aware that standalone dylibs are not supported on iOS, and we need to wrap them in a framework.
For my use case, the framework will literally be a wrapper, it won't have any source files of its own. It should only contain the dynamic lib generated from some independent codebase. I am not sure how to place the dylib in the framework.
Hi, I have an iOS project with the following app targets:
main iOS application
a notification service extension
5 static libs containing some swift files with public methods
1 dynamic framework with above static libs as dependencies.
The framework only contains 2 files - a default .h file and 1 .exp file. This exports file contains mangled-names of all the public methods that are exposed by the 5 static libs present as framework's dependencies. I obtained these symbols using the nm command for each static lib.
The main iOS app target has 2 dependencies - the framework and the notification extension.
The notification extension only depends on the framework.
This setup works perfectly fine. I wanted to understand:
If using the exports file is the only way to make this setup work?
If not, what else can I do?
What way does Apple recommend?
According to my requirements, I only need at-most 2-3 functions to be exposed by the framework - thus using a exports file just for that seems to bug me.
Thank you.
In my code I use a binding that use 2 methods to get and get a value. There is no problem with swift 5 but when I swift to swift 6 the compiler fails :
Here a sample example of code to reproduce the problem :
`import SwiftUI
struct ContentView: View {
@State private var isOn = false
var body: some View {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundStyle(.tint)
Text("Hello, world!")
Toggle("change it", isOn: Binding(get: getValue, set: setValue(_:)))
}
.padding()
}
private func getValue() -> Bool {
isOn
}
private func setValue(_ value: Bool) {
isOn = value
}
}`
Xcode compiler log error :
1. Apple Swift version 6.1.2 (swiftlang-6.1.2.1.2 clang-1700.0.13.5) 2. Compiling with the current language version 3. While evaluating request IRGenRequest(IR Generation for file "/Users/xavierrouet/Developer/TestCompilBindingSwift6/TestCompilBindingSwift6/ContentView.swift") 4. While emitting IR SIL function "@$sSbScA_pSgIeAghyg_SbIeAghn_TR". for <<debugloc at "<compiler-generated>":0:0>>Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var LLVM_SYMBOLIZER_PATH` to point to it):
0 swift-frontend 0x000000010910ae24 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1 swift-frontend 0x0000000109108c5c llvm::sys::RunSignalHandlers() + 112
2 swift-frontend 0x000000010910b460 SignalHandler(int) + 360
3 libsystem_platform.dylib 0x0000000188e60624 _sigtramp + 56
4 libsystem_pthread.dylib 0x0000000188e2688c pthread_kill + 296
5 libsystem_c.dylib 0x0000000188d2fc60 abort + 124
6 swift-frontend 0x00000001032ff9a8 swift::DiagnosticHelper::~DiagnosticHelper() + 0
7 swift-frontend 0x000000010907a878 llvm::report_fatal_error(llvm::Twine const&, bool) + 280
8 swift-frontend 0x00000001090aef6c report_at_maximum_capacity(unsigned long) + 0
9 swift-frontend 0x00000001090aec7c llvm::SmallVectorBase::grow_pod(void*, unsigned long, unsigned long) + 384
10 swift-frontend 0x000000010339c418 (anonymous namespace)::SyncCallEmission::setArgs(swift::irgen::Explosion&, bool, swift::irgen::WitnessMetadata*) + 892
11 swift-frontend 0x00000001035f8104 (anonymous namespace)::IRGenSILFunction::visitFullApplySite(swift::FullApplySite) + 4792
12 swift-frontend 0x00000001035c876c (anonymous namespace)::IRGenSILFunction::visitSILBasicBlock(swift::SILBasicBlock*) + 2636
13 swift-frontend 0x00000001035c6614 (anonymous namespace)::IRGenSILFunction::emitSILFunction() + 15860
14 swift-frontend 0x00000001035c2368 swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 2788
15 swift-frontend 0x00000001033e7c1c swift::irgen::IRGenerator::emitLazyDefinitions() + 5288
16 swift-frontend 0x0000000103573d6c swift::IRGenRequest::evaluate(swift::Evaluator&, swift::IRGenDescriptor) const + 4528
17 swift-frontend 0x00000001035c15c4 swift::SimpleRequest<swift::IRGenRequest, swift::GeneratedModule (swift::IRGenDescriptor), (swift::RequestFlags)17>::evaluateRequest(swift::IRGenRequest const&, swift::Evaluator&) + 180
18 swift-frontend 0x000000010357d1b0 swift::IRGenRequest::OutputType swift::Evaluator::getResultUncached<swift::IRGenRequest, swift::IRGenRequest::OutputType swift::evaluateOrFatalswift::IRGenRequest(swift::Evaluator&, swift::IRGenRequest)::'lambda'()>(swift::IRGenRequest const&, swift::IRGenRequest::OutputType swift::evaluateOrFatalswift::IRGenRequest(swift::Evaluator&, swift::IRGenRequest)::'lambda'()) + 812
19 swift-frontend 0x0000000103576910 swift::performIRGeneration(swift::FileUnit*, swift::IRGenOptions const&, swift::TBDGenOptions const&, std::__1::unique_ptr<swift::SILModule, std::__1::default_deleteswift::SILModule>, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::StringRef, llvm::GlobalVariable**) + 176
20 swift-frontend 0x0000000102f61af0 generateIR(swift::IRGenOptions const&, swift::TBDGenOptions const&, std::__1::unique_ptr<swift::SILModule, std::__1::default_deleteswift::SILModule>, swift::PrimarySpecificPaths const&, llvm::StringRef, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, llvm::GlobalVariable*&, llvm::ArrayRef<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator>>) + 156
21 swift-frontend 0x0000000102f5d07c performCompileStepsPostSILGen(swift::CompilerInstance&, std::__1::unique_ptr<swift::SILModule, std::__1::default_deleteswift::SILModule>, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver*) + 2108
22 swift-frontend 0x0000000102f5c0a8 swift::performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 1036
23 swift-frontend 0x0000000102f5f654 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 1764
24 swift-frontend 0x0000000102f5dfd8 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3716
25 swift-frontend 0x0000000102ee20bc swift::mainEntry(int, char const**) + 5428
26 dyld 0x0000000188a86b98 start + 6076
Using Xcode 16.4 / Mac OS 16.4
It has been two years since I wrote my a SwiftUI app, and I wanted to start again in Xcode 26. I can no longer see the attributes inspector when I select an element in the canvas. This was an Xcode feature that was very helpful as I am still a novice. Has this feature been deprecated in Xcode 26? And if not, please help explain how I can find and use it.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
Developer Tools
Interface Builder
Xcode
SwiftUI
Hi, I am using xCode26.x. But my Metal4 classes are not compiling. I downloaded the sample code from Apple's website - https://developer.apple.com/documentation/Metal/processing-a-texture-in-a-compute-function. For example, I am getting errors like "Cannot find protocol declaration for 'MTL4CommandQueue';
I have hit a deadline. Any recommendations are very welcome.
I have downloaded the Metal Tool chain. When I run the following commands on the terminal - xcodebuild -showComponent metalToolchain ; xcrun -f metal ; xcrun metal --version
I get the following response -
Asset Path: /System/Library/AssetsV2/com_apple_MobileAsset_MetalToolchain/86fbaf7b114a899754307896c0bfd52ffbf4fded.asset/AssetData
Build Version: 17A321
Status: installed
Toolchain Identifier: com.apple.dt.toolchain.Metal.32023
Toolchain Search Path: /Users/private/Library/Developer/DVTDownloads/MetalToolchain/mounts/86fbaf7b114a899754307896c0bfd52ffbf4fded
/Users/private/Library/Developer/DVTDownloads/MetalToolchain/mounts/86fbaf7b114a899754307896c0bfd52ffbf4fded/Metal.xctoolchain/usr/bin/metal
Apple metal version 32023.830 (metalfe-32023.830.2)
Target: air64-apple-darwin24.6.0
Thread model: posix
InstalledDir: /Users/private/Library/Developer/DVTDownloads/MetalToolchain/mounts/86fbaf7b114a899754307896c0bfd52ffbf4fded/Metal.xctoolchain/usr/metal/current/bin
I've recently installed 26.1 Beta 3 alongside stable 26.0.1
When building my app with 26.0.1 the final .ipa size is ~17mb, however after building my app with 26.1 Beta 3 the size has increased up to ~22mb
The main difference is Assets.car blowing from 1.1mb to 5.6mb (or 8.6mb if I include all icons settings). Upon examining I've found new liquid glass .icon file duplicating itself multiple times as png variants (any, dark, tinted, etc).
Is anyone else experiencing this issue?
I'm experiencing the following error with my SwiftData container when running a build:
Code=134504 "Cannot use staged migration with an unknown model version."
Code Structure - Summary
I am using a versionedSchema to store multiple models in SwiftData. I started experiencing this issue when adding two new models in the newest Schema version. Starting from the current public version, V4.4.6, there are two migrations.
Migration Summary
The first migration is to V4.4.7. This is a lightweight migration removing one attribute from one of the models. This was tested and worked successfully.
The second migration is to V5.0.0. This is a custom migration adding two new models, and instantiating instances of the two new models based on data from instances of the existing models. In the initial testing of this version, no issues were observed.
Issue and Steps to Reproduce
Reproduction of issue: Starting from a fresh build of the publicly released V4.4.6, I run a new build that contains both Schema Versions (V4.4.7 and V5.0.0), and their associated migration stages. This builds successfully, and the container successfully migrates to V5.0.0. Checking the default.store file, all values appear to migrate and instantiate correctly.
The second step in reproduction of the issue is to simply stop running the build, and then rebuild, without any code changes. This fails to initialize the model container every time afterwards. Going back to the simulator after successive builds are stopped in Xcode, the app launches and accesses/modifies the model container as normal.
Supplementary Issue: I have been putting up with the same, persistent issue in the Xcode Preview Canvas of "Failed to Initialize Model Container" This is a 5 in 6 build issue, where builds will work at random. In the case of previews, I have cleared all data associated with all previews multiple times. The only difference being that the simulator is a 100% failure rate after the initial, successful initialization. I assume this is due to the different build structure of previews. Lastly, of note, the Xcode previews fail at the same line in instantiating the model container as the simulator does. From my research into this issue, people say that the Xcode preview is instantiating from elsewhere. I do have a separate model container set up specifically for canvas previews, but the error does not occur in that container, but rather the app's main container.
Possible Contributing Factors & Tested Facts
iOS: While I have experienced issues with SwiftData and the complier in iOS 26, I can rule that out as the issue here. This has been tested on simulators running iOS 18.6, 26.0.1, and 26.1, all encountering failures to initialize model container. While in iOS 18, subsequent builds after the successful migration did work, I did eventually encounter the same error and crash. In iOS 26.0.1 and 26.1, these errors come immediately on the second build.
Container Initialization for V4.4.6
do {
container = try ModelContainer(
for:
Job.self,
JobTask.self,
Day.self,
Charge.self,
Material.self,
Person.self,
TaskCategory.self,
Service.self,
migrationPlan: JobifyMigrationPlan.self
)
} catch {
fatalError("Failed to Initialize Model Container")
}
Versioned Schema Instance for V4.4.6 (V4.4.7 differs only by versionIdentifier)
static var versionIdentifier = Schema.Version(4, 4, 6)
static var models: [any PersistentModel.Type] {
[Job.self, JobTask.self, Day.self, Charge.self, Material.self, Person.self, TaskCategory.self, Service.self]
}
Container Initialization for V5.0.0
do {
let schema = Schema([Jobify.self,
JobTask.self,
Day.self,
Charge.self,
MaterialItem.self,
Person.self,
TaskCategory.self,
Service.self,
ServiceJob.self,
RecurerRule.self])
container = try ModelContainer(
for: schema, migrationPlan: JobifyMigrationPlan.self
)
} catch {
fatalError("Failed to Initialize Model Container")
}
Versioned Schema Instance for V5.0.0
static var versionIdentifier = Schema.Version(5, 0, 0)
static var models: [any PersistentModel.Type] {
[
JobifySchemaV500.Job.self,
JobifySchemaV500.JobTask.self,
JobifySchemaV500.Day.self,
JobifySchemaV500.Charge.self,
JobifySchemaV500.Material.self,
JobifySchemaV500.Person.self,
JobifySchemaV500.TaskCategory.self,
JobifySchemaV500.Service.self,
JobifySchemaV500.ServiceJob.self,
JobifySchemaV500.RecurerRule.self
]
}
Addressing Differences in Object Names
Type-aliasing: All my model types are type-aliased for simplification in view components. All types are aliased as 'JobifySchemeV446.<#Name#>' in V.4.4.6, and 'JobifySchemaV500.<#Name#>' in V5.0.0
Issues with iOS 26: My type-aliases dating back to iOS 17 overlapped with lower level objects in Swift, including 'Job' and 'Material'. These started to be an issue with initializing the model container when running in iOS 26. The type aliases have been renamed since, however the V4.4.6 build with the old names runs and builds perfectly fine in iOS 26
If there is any other code that may be relevant in determining where this error is occurring, I would be happy to add it. My current best theory is simply that I have mistakenly omitted code relevant to the SwiftData Migration.
This is using:
**Unity 6000.2.7f - latest ARKit etc
Xcode 26.1 **
This is going to iPad/iPhone/iOS and I have succesfully built to the iPad before, but updates to the software seem to have added these errors in.
Basically all updated as much as possible.
Originally I got 5 errors, but updates brought it down.
On build I now get 3 undefined symbols:
Undefined symbol: _swift_FORCE_LOAD$_swiftCompatibility51
Undefined symbol: _swift_FORCE_LOAD$_swiftCompatibility56
Undefined symbol: _swift_FORCE_LOAD$_swiftCompatibilityConcurrency
This appears to be a bug, or issue, that is in some way known, but I'm not sure how best to get past it.
ld: warning: search path '/var/run/com.apple.security.cryptexd/mnt/com.apple.MobileAsset.MetalToolchain-v17.1.324.0.kGuqPt/Metal.xctoolchain/usr/lib/swift/iphoneos' not found
ld: warning: search path '/var/run/com.apple.security.cryptexd/mnt/com.apple.MobileAsset.MetalToolchain-v17.1.324.0.kGuqPt/Metal.xctoolchain/usr/lib/swift-5.0/iphoneos' not found
ld: warning: Could not find or use auto-linked library 'swiftCompatibility51': library 'swiftCompatibility51' not found
ld: warning: Could not find or use auto-linked library 'swiftCompatibility56': library 'swiftCompatibility56' not found
ld: warning: Could not find or use auto-linked library 'swiftCompatibilityConcurrency': library 'swiftCompatibilityConcurrency' not found
ld: warning: Could not find or use auto-linked library 'swiftCompatibilityPacks': library 'swiftCompatibilityPacks' not found
ld: warning: Could not find or use auto-linked framework 'CoreAudioTypes': framework 'CoreAudioTypes' not found
ld: warning: Could not find or use auto-linked framework 'UIUtilities': framework 'UIUtilities' not found
ld: warning: Could not parse or use implicit file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SwiftUICore.framework/SwiftUICore.tbd': cannot link directly with 'SwiftUICore' because product being built is not an allowed client of it
Undefined symbols for architecture arm64:
"_swift_FORCE_LOAD$_swiftCompatibility51", referenced from:
_swift_FORCE_LOAD$swiftCompatibility51$_UnityARKit in libUnityARKit.a[49](RoomCaptureSessionWrapper. o)
"_swift_FORCE_LOAD$_swiftCompatibility56", referenced from:
_swift_FORCE_LOAD$swiftCompatibility56$_UnityARKit in libUnityARKit.a[49](RoomCaptureSessionWrapper. o)
"_swift_FORCE_LOAD$_swiftCompatibilityConcurrency", referenced from:
_swift_FORCE_LOAD$swiftCompatibilityConcurrency$_UnityARKit in libUnityARKit.a[49](RoomCaptureSessionWrapper. o)
ld: symbol(s) not found for architecture arm64
clang++: error: linker command failed with exit code 1 (use -v to see invocation)