Post

Replies

Boosts

Views

Activity

iOS 26 SwiftData crash does not happen in iOS 16
I have a simple app that makes an HTTPS call to gather some JSON which I then parse and add to my SwiftData database. The app then uses a simple @Query in a view to get the data into a list. on iOS 16 this works fine. No problems. But the same code on iOS 26 (targeting iOS 18.5) crashes after about 15 seconds of idle time after the list is populated. The error message is: Could not cast value of type '__NSCFNumber' (0x1f31ee568) to 'NSString' (0x1f31ec718). and occurs when trying to access ANY property of the list. I have a stripped down version of the app that shows the crash available. To replicate the issue: open the project in Xcode 26 target any iOS 26 device or simulator compile and run the project. after the list is displayed, wait about 15 seconds and the app crashes. It is also of note that if you try to run the app again, it will crash immediately, unless you delete the app from the device. Any help on this would be appreciated. Feedback number FB20295815 includes .zip file Below is the basic code (without the data models) The Best Seller List.Swift import SwiftUI import SwiftData @main struct Best_Seller_ListApp: App { var body: some Scene { WindowGroup { ContentView() } .modelContainer (for: NYTOverviewResponse.self) } } ContentView.Swift import os.log import SwiftUI struct ContentView: View { @Environment(\.modelContext) var modelContext @State private var listEncodedName = String() var body: some View { NavigationStack () { ListsView() } .task { await getBestSellerLists() } } func getBestSellerLists() async { guard let url = URL(string: "https://api.nytimes.com/svc/books/v3/lists/overview.json?api-key=\(NYT_API_KEY)") else { Logger.errorLog.error("Invalid URL") return } do { let decoder = JSONDecoder() var decodedResponse = NYTOverviewResponse() //decode the JSON let (data, _) = try await URLSession.shared.data(from: url) decoder.keyDecodingStrategy = .convertFromSnakeCase decodedResponse = try decoder.decode(NYTOverviewResponse.self, from: data) //remove any lists that don't have list_name_encoded. Fixes a bug in the data decodedResponse.results!.lists = decodedResponse.results!.lists!.filter { $0.listNameEncoded != "" } // sort the lists decodedResponse.results!.lists!.sort { (lhs, rhs) -> Bool in lhs.displayName < rhs.displayName } //delete any potential existing data try modelContext.delete(model: NYTOverviewResponse.self) //add the new data modelContext.insert(decodedResponse) } catch { Logger.errorLog.error("\(error.localizedDescription)") } } } ListsView.Swift import os.log import SwiftData import SwiftUI @MainActor struct ListsView: View { //MARK: - Variables and Constants @Query var nytOverviewResponses: [NYTOverviewResponse] enum Updated: String { case weekly = "WEEKLY" case monthly = "MONTHLY" } //MARK: - Main View var body: some View { List { if nytOverviewResponses.isEmpty { ContentUnavailableView("No lists yet", systemImage: "list.bullet", description: Text("NYT Bestseller lists not downloaded yet")) } else { WeeklySection MonthlySection } } .navigationBarTitle("Bestseller Lists", displayMode: .large) .listStyle(.grouped) } var WeeklySection: some View { let rawLists = nytOverviewResponses.last?.results?.lists ?? [] // Build a value-typed array to avoid SwiftData faulting during sort let weekly = rawLists .filter { $0.updateFrequency == Updated.weekly.rawValue } .map { (name: $0.displayName, encoded: $0.listNameEncoded, model: $0) } .sorted { $0.name < $1.name } return Section(header: Text("Weekly lists to be published on \(nytOverviewResponses.last?.results?.publishedDate ?? "-")")) { ForEach(weekly, id: \.encoded) { item in Text(item.name).font(Font.custom("Georgia", size: 17)) } } } var MonthlySection: some View { let rawLists = nytOverviewResponses.last?.results?.lists ?? [] // Build a value-typed array to avoid SwiftData faulting during sort let monthly = rawLists .filter { $0.updateFrequency == Updated.monthly.rawValue } .map { (name: $0.displayName, encoded: $0.listNameEncoded, model: $0) } .sorted { $0.name < $1.name } return Section(header: Text("Monthly lists to be published on \(nytOverviewResponses.last?.results?.publishedDate ?? "-")")) { ForEach(monthly, id: \.encoded) { item in Text(item.name).font(Font.custom("Georgia", size: 17)) } } } }
4
0
410
Sep ’25
Xcode 16.4 no longer installs a development app onto any of my devices
Unable to Install “The BestSeller List” Building a new app when all of a sudden when I try to run on ANY of my devices, I get the following message: Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.HXa0sV/extracted/Best Seller List.app : 0xe8008015 (A valid provisioning profile for this executable was not found.) I have tried all of the suggestions I have found online: clean build folder, delete derived data, rebooting, etc. Nothing works. This happens on ALL of my test devices: iPhone 16 Pro, iPhone 14 Pro, iPhone XS, iPad Pro 6th gen. Here is the complete message dump: Unable to Install “The BestSeller List” Domain: IXUserPresentableErrorDomain Code: 14 Recovery Suggestion: Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.HXa0sV/extracted/Best Seller List.app : 0xe8008015 (A valid provisioning profile for this executable was not found.) Please ensure sure that your app is signed by a valid provisioning profile. If this issue persists, please attach the following when sending a report to Apple: A sysdiagnose from this Mac A sysdiagnose from the device failing installation An IPA of the app failing installation User Info: { DVTErrorCreationDateKey = "2025-07-10 01:20:54 +0000"; IDERunOperationFailingWorker = IDEInstallCoreDeviceWorker; } Failed to install the app on the device. Domain: com.apple.dt.CoreDeviceError Code: 3002 User Info: { NSURL = "file:///Users/feldy/Library/Developer/Xcode/DerivedData/Best_Seller_List-aziaphmgvhweszapcqlicacwcuow/Build/Products/Debug-iphoneos/Best%20Seller%20List.app"; } Unable to Install “The BestSeller List” Domain: IXUserPresentableErrorDomain Code: 14 Failure Reason: This app cannot be installed because its integrity could not be verified. Recovery Suggestion: Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.HXa0sV/extracted/Best Seller List.app : 0xe8008015 (A valid provisioning profile for this executable was not found.) Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.HXa0sV/extracted/Best Seller List.app : 0xe8008015 (A valid provisioning profile for this executable was not found.) Domain: MIInstallerErrorDomain Code: 13 User Info: { FunctionName = "+[MICodeSigningVerifier _validateSignatureAndCopyInfoForURL:withOptions:error:]"; LegacyErrorString = ApplicationVerificationFailed; LibMISErrorNumber = "-402620395"; SourceFileLine = 80; } Event Metadata: com.apple.dt.IDERunOperationWorkerFinished : { "device_identifier" = "00008140-001C6C461AFB001C"; "device_isCoreDevice" = 1; "device_model" = "iPhone17,1"; "device_osBuild" = "18.5 (22F76)"; "device_platform" = "com.apple.platform.iphoneos"; "device_thinningType" = "iPhone17,1"; "dvt_coredevice_version" = "477.25"; "dvt_coresimulator_version" = 1043; "dvt_mobiledevice_version" = "1818.0.1"; "launchSession_schemeCommand" = Run; "launchSession_state" = 1; "launchSession_targetArch" = arm64; "operation_duration_ms" = 18446; "operation_errorCode" = 14; "operation_errorDomain" = IXUserPresentableErrorDomain; "operation_errorWorker" = IDEInstallCoreDeviceWorker; "operation_name" = IDERunOperationWorkerGroup; "param_debugger_attachToExtensions" = 0; "param_debugger_attachToXPC" = 1; "param_debugger_type" = 3; "param_destination_isProxy" = 0; "param_destination_platform" = "com.apple.platform.iphoneos"; "param_diag_113575882_enable" = 0; "param_diag_MainThreadChecker_stopOnIssue" = 0; "param_diag_MallocStackLogging_enableDuringAttach" = 0; "param_diag_MallocStackLogging_enableForXPC" = 1; "param_diag_allowLocationSimulation" = 1; "param_diag_checker_tpc_enable" = 1; "param_diag_gpu_frameCapture_enable" = 0; "param_diag_gpu_shaderValidation_enable" = 0; "param_diag_gpu_validation_enable" = 0; "param_diag_guardMalloc_enable" = 0; "param_diag_memoryGraphOnResourceException" = 0; "param_diag_mtc_enable" = 1; "param_diag_queueDebugging_enable" = 1; "param_diag_runtimeProfile_generate" = 0; "param_diag_sanitizer_asan_enable" = 0; "param_diag_sanitizer_tsan_enable" = 0; "param_diag_sanitizer_tsan_stopOnIssue" = 0; "param_diag_sanitizer_ubsan_enable" = 0; "param_diag_sanitizer_ubsan_stopOnIssue" = 0; "param_diag_showNonLocalizedStrings" = 0; "param_diag_viewDebugging_enabled" = 1; "param_diag_viewDebugging_insertDylibOnLaunch" = 1; "param_install_style" = 2; "param_launcher_UID" = 2; "param_launcher_allowDeviceSensorReplayData" = 0; "param_launcher_kind" = 0; "param_launcher_style" = 99; "param_launcher_substyle" = 0; "param_runnable_appExtensionHostRunMode" = 0; "param_runnable_productType" = "com.apple.product-type.application"; "param_structuredConsoleMode" = 1; "param_testing_launchedForTesting" = 0; "param_testing_suppressSimulatorApp" = 0; "param_testing_usingCLI" = 0; "sdk_canonicalName" = "iphoneos18.5"; "sdk_osVersion" = "18.5"; "sdk_variant" = iphoneos; } System Information macOS Version 15.5 (Build 24F74) Xcode 16.4 (23792) (Build 16F6) Timestamp: 2025-07-09T18:20:54-07:00
3
1
835
Jul ’25
Crash when adding large JSON data to SwiftData: Could not cast value of type '__NSCFBoolean' to 'NSString'
Within the app main struct, the SwiftData modelContainer is created by fetching and decoding JSON from remote site. The decoded data is inserted into the modelContext. Immediately thereafter, the app crashes with the error Could not cast value of type '__NSCFBoolean' to 'NSString' . I have run the JSON from the site through JSON lint and it is correctly structured. The JSON data is structured as follows: Overview object which includes a Result object which includes a List Array. Each List object includes a Books Array. I have run the app through AI and the result indicates that there is data corruption when adding the data to the database. The AI rewrote the code such that the book data is encoded into a data blob and then adds the data to the database, instead of adding the individual books (which is extensive.) This approach works without crashing, but I would like to find out if this is indeed a SwiftData issue.
4
0
756
Jul ’25
Xcode 15 beta 5 External macro implementation type 'ObservationMacros.ObservableMacro' could not be found for macro 'Observable()
Using Xcode 15 Beta 5 the following error now appears when building an app with @Observable External macro implementation type 'ObservationMacros.ObservableMacro' could not be found for macro 'Observable()'; the type must be public and provided by a macro target in a Swift package, or via '-plugin-path' or '-load-plugin-library' See the attached image. This does not happen on other team member’s computer. He can compile app just fine and I can compile app file on Xcode 15 beta 4 and below. This just started happening with Beta 5 installation. I have deleted all derived data, deleted the Derived data folder for the project, restarted Xcode, restarted machine, reinstalled Xcode 15 beta 5. Nothing helps.
7
5
4.6k
Oct ’23
iOS 26 SwiftData crash does not happen in iOS 16
I have a simple app that makes an HTTPS call to gather some JSON which I then parse and add to my SwiftData database. The app then uses a simple @Query in a view to get the data into a list. on iOS 16 this works fine. No problems. But the same code on iOS 26 (targeting iOS 18.5) crashes after about 15 seconds of idle time after the list is populated. The error message is: Could not cast value of type '__NSCFNumber' (0x1f31ee568) to 'NSString' (0x1f31ec718). and occurs when trying to access ANY property of the list. I have a stripped down version of the app that shows the crash available. To replicate the issue: open the project in Xcode 26 target any iOS 26 device or simulator compile and run the project. after the list is displayed, wait about 15 seconds and the app crashes. It is also of note that if you try to run the app again, it will crash immediately, unless you delete the app from the device. Any help on this would be appreciated. Feedback number FB20295815 includes .zip file Below is the basic code (without the data models) The Best Seller List.Swift import SwiftUI import SwiftData @main struct Best_Seller_ListApp: App { var body: some Scene { WindowGroup { ContentView() } .modelContainer (for: NYTOverviewResponse.self) } } ContentView.Swift import os.log import SwiftUI struct ContentView: View { @Environment(\.modelContext) var modelContext @State private var listEncodedName = String() var body: some View { NavigationStack () { ListsView() } .task { await getBestSellerLists() } } func getBestSellerLists() async { guard let url = URL(string: "https://api.nytimes.com/svc/books/v3/lists/overview.json?api-key=\(NYT_API_KEY)") else { Logger.errorLog.error("Invalid URL") return } do { let decoder = JSONDecoder() var decodedResponse = NYTOverviewResponse() //decode the JSON let (data, _) = try await URLSession.shared.data(from: url) decoder.keyDecodingStrategy = .convertFromSnakeCase decodedResponse = try decoder.decode(NYTOverviewResponse.self, from: data) //remove any lists that don't have list_name_encoded. Fixes a bug in the data decodedResponse.results!.lists = decodedResponse.results!.lists!.filter { $0.listNameEncoded != "" } // sort the lists decodedResponse.results!.lists!.sort { (lhs, rhs) -> Bool in lhs.displayName < rhs.displayName } //delete any potential existing data try modelContext.delete(model: NYTOverviewResponse.self) //add the new data modelContext.insert(decodedResponse) } catch { Logger.errorLog.error("\(error.localizedDescription)") } } } ListsView.Swift import os.log import SwiftData import SwiftUI @MainActor struct ListsView: View { //MARK: - Variables and Constants @Query var nytOverviewResponses: [NYTOverviewResponse] enum Updated: String { case weekly = "WEEKLY" case monthly = "MONTHLY" } //MARK: - Main View var body: some View { List { if nytOverviewResponses.isEmpty { ContentUnavailableView("No lists yet", systemImage: "list.bullet", description: Text("NYT Bestseller lists not downloaded yet")) } else { WeeklySection MonthlySection } } .navigationBarTitle("Bestseller Lists", displayMode: .large) .listStyle(.grouped) } var WeeklySection: some View { let rawLists = nytOverviewResponses.last?.results?.lists ?? [] // Build a value-typed array to avoid SwiftData faulting during sort let weekly = rawLists .filter { $0.updateFrequency == Updated.weekly.rawValue } .map { (name: $0.displayName, encoded: $0.listNameEncoded, model: $0) } .sorted { $0.name < $1.name } return Section(header: Text("Weekly lists to be published on \(nytOverviewResponses.last?.results?.publishedDate ?? "-")")) { ForEach(weekly, id: \.encoded) { item in Text(item.name).font(Font.custom("Georgia", size: 17)) } } } var MonthlySection: some View { let rawLists = nytOverviewResponses.last?.results?.lists ?? [] // Build a value-typed array to avoid SwiftData faulting during sort let monthly = rawLists .filter { $0.updateFrequency == Updated.monthly.rawValue } .map { (name: $0.displayName, encoded: $0.listNameEncoded, model: $0) } .sorted { $0.name < $1.name } return Section(header: Text("Monthly lists to be published on \(nytOverviewResponses.last?.results?.publishedDate ?? "-")")) { ForEach(monthly, id: \.encoded) { item in Text(item.name).font(Font.custom("Georgia", size: 17)) } } } }
Replies
4
Boosts
0
Views
410
Activity
Sep ’25
Xcode 16.4 no longer installs a development app onto any of my devices
Unable to Install “The BestSeller List” Building a new app when all of a sudden when I try to run on ANY of my devices, I get the following message: Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.HXa0sV/extracted/Best Seller List.app : 0xe8008015 (A valid provisioning profile for this executable was not found.) I have tried all of the suggestions I have found online: clean build folder, delete derived data, rebooting, etc. Nothing works. This happens on ALL of my test devices: iPhone 16 Pro, iPhone 14 Pro, iPhone XS, iPad Pro 6th gen. Here is the complete message dump: Unable to Install “The BestSeller List” Domain: IXUserPresentableErrorDomain Code: 14 Recovery Suggestion: Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.HXa0sV/extracted/Best Seller List.app : 0xe8008015 (A valid provisioning profile for this executable was not found.) Please ensure sure that your app is signed by a valid provisioning profile. If this issue persists, please attach the following when sending a report to Apple: A sysdiagnose from this Mac A sysdiagnose from the device failing installation An IPA of the app failing installation User Info: { DVTErrorCreationDateKey = "2025-07-10 01:20:54 +0000"; IDERunOperationFailingWorker = IDEInstallCoreDeviceWorker; } Failed to install the app on the device. Domain: com.apple.dt.CoreDeviceError Code: 3002 User Info: { NSURL = "file:///Users/feldy/Library/Developer/Xcode/DerivedData/Best_Seller_List-aziaphmgvhweszapcqlicacwcuow/Build/Products/Debug-iphoneos/Best%20Seller%20List.app"; } Unable to Install “The BestSeller List” Domain: IXUserPresentableErrorDomain Code: 14 Failure Reason: This app cannot be installed because its integrity could not be verified. Recovery Suggestion: Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.HXa0sV/extracted/Best Seller List.app : 0xe8008015 (A valid provisioning profile for this executable was not found.) Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.HXa0sV/extracted/Best Seller List.app : 0xe8008015 (A valid provisioning profile for this executable was not found.) Domain: MIInstallerErrorDomain Code: 13 User Info: { FunctionName = "+[MICodeSigningVerifier _validateSignatureAndCopyInfoForURL:withOptions:error:]"; LegacyErrorString = ApplicationVerificationFailed; LibMISErrorNumber = "-402620395"; SourceFileLine = 80; } Event Metadata: com.apple.dt.IDERunOperationWorkerFinished : { "device_identifier" = "00008140-001C6C461AFB001C"; "device_isCoreDevice" = 1; "device_model" = "iPhone17,1"; "device_osBuild" = "18.5 (22F76)"; "device_platform" = "com.apple.platform.iphoneos"; "device_thinningType" = "iPhone17,1"; "dvt_coredevice_version" = "477.25"; "dvt_coresimulator_version" = 1043; "dvt_mobiledevice_version" = "1818.0.1"; "launchSession_schemeCommand" = Run; "launchSession_state" = 1; "launchSession_targetArch" = arm64; "operation_duration_ms" = 18446; "operation_errorCode" = 14; "operation_errorDomain" = IXUserPresentableErrorDomain; "operation_errorWorker" = IDEInstallCoreDeviceWorker; "operation_name" = IDERunOperationWorkerGroup; "param_debugger_attachToExtensions" = 0; "param_debugger_attachToXPC" = 1; "param_debugger_type" = 3; "param_destination_isProxy" = 0; "param_destination_platform" = "com.apple.platform.iphoneos"; "param_diag_113575882_enable" = 0; "param_diag_MainThreadChecker_stopOnIssue" = 0; "param_diag_MallocStackLogging_enableDuringAttach" = 0; "param_diag_MallocStackLogging_enableForXPC" = 1; "param_diag_allowLocationSimulation" = 1; "param_diag_checker_tpc_enable" = 1; "param_diag_gpu_frameCapture_enable" = 0; "param_diag_gpu_shaderValidation_enable" = 0; "param_diag_gpu_validation_enable" = 0; "param_diag_guardMalloc_enable" = 0; "param_diag_memoryGraphOnResourceException" = 0; "param_diag_mtc_enable" = 1; "param_diag_queueDebugging_enable" = 1; "param_diag_runtimeProfile_generate" = 0; "param_diag_sanitizer_asan_enable" = 0; "param_diag_sanitizer_tsan_enable" = 0; "param_diag_sanitizer_tsan_stopOnIssue" = 0; "param_diag_sanitizer_ubsan_enable" = 0; "param_diag_sanitizer_ubsan_stopOnIssue" = 0; "param_diag_showNonLocalizedStrings" = 0; "param_diag_viewDebugging_enabled" = 1; "param_diag_viewDebugging_insertDylibOnLaunch" = 1; "param_install_style" = 2; "param_launcher_UID" = 2; "param_launcher_allowDeviceSensorReplayData" = 0; "param_launcher_kind" = 0; "param_launcher_style" = 99; "param_launcher_substyle" = 0; "param_runnable_appExtensionHostRunMode" = 0; "param_runnable_productType" = "com.apple.product-type.application"; "param_structuredConsoleMode" = 1; "param_testing_launchedForTesting" = 0; "param_testing_suppressSimulatorApp" = 0; "param_testing_usingCLI" = 0; "sdk_canonicalName" = "iphoneos18.5"; "sdk_osVersion" = "18.5"; "sdk_variant" = iphoneos; } System Information macOS Version 15.5 (Build 24F74) Xcode 16.4 (23792) (Build 16F6) Timestamp: 2025-07-09T18:20:54-07:00
Replies
3
Boosts
1
Views
835
Activity
Jul ’25
Crash when adding large JSON data to SwiftData: Could not cast value of type '__NSCFBoolean' to 'NSString'
Within the app main struct, the SwiftData modelContainer is created by fetching and decoding JSON from remote site. The decoded data is inserted into the modelContext. Immediately thereafter, the app crashes with the error Could not cast value of type '__NSCFBoolean' to 'NSString' . I have run the JSON from the site through JSON lint and it is correctly structured. The JSON data is structured as follows: Overview object which includes a Result object which includes a List Array. Each List object includes a Books Array. I have run the app through AI and the result indicates that there is data corruption when adding the data to the database. The AI rewrote the code such that the book data is encoded into a data blob and then adds the data to the database, instead of adding the individual books (which is extensive.) This approach works without crashing, but I would like to find out if this is indeed a SwiftData issue.
Replies
4
Boosts
0
Views
756
Activity
Jul ’25
Xcode 15 beta 5 External macro implementation type 'ObservationMacros.ObservableMacro' could not be found for macro 'Observable()
Using Xcode 15 Beta 5 the following error now appears when building an app with @Observable External macro implementation type 'ObservationMacros.ObservableMacro' could not be found for macro 'Observable()'; the type must be public and provided by a macro target in a Swift package, or via '-plugin-path' or '-load-plugin-library' See the attached image. This does not happen on other team member’s computer. He can compile app just fine and I can compile app file on Xcode 15 beta 4 and below. This just started happening with Beta 5 installation. I have deleted all derived data, deleted the Derived data folder for the project, restarted Xcode, restarted machine, reinstalled Xcode 15 beta 5. Nothing helps.
Replies
7
Boosts
5
Views
4.6k
Activity
Oct ’23