Search results for

NSCocoaErrorDomain

1,063 results found

Post

Replies

Boosts

Views

Activity

Reply to Enable access to Documents Directory in Xcode 13
What I am trying to do is export a collection of Markdown files into an EPUB book. To create the EPUB book I start by creating a file wrapper that has everything the EPUB needs. I finish by using the ZIPFoundation framework to compress the file wrapper into a valid EPUB/Zip archive. When I finish building the file wrapper, I call the FileWrapper class's write function to temporarily create the file so ZIPFoundation can compress and archive it. do { // mainDirectory is the file wrapper root. wrapperURL is the location to export // from either the file exporter panel or NSSavePanel. try mainDirectory.write(to: wrapperURL, options: [], originalContentsURL: nil) } catch { Swift.print(Error temporarily writing the book's file wrapper to disk. Error: (error)) } When I step through this code in the debugger, it goes to the catch block and prints the following message in the console: Error: Error Domain=NSCocoaErrorDomain Code=513 You don’t have permission to save the file TestBook in the location (path to f
Topic: Code Signing SubTopic: General Tags:
Sep ’21
Reply to Photos app crashes on launch in Catalina
I now get this as well on start, then Photos quits:Error Domain=PHPhotosErrorDomain Code=5103 PHPhotosErrorBookmarkResolutionFailed UserInfo={NSURL=file:///Users/xxx/Pictures/Photos%20Library.photoslibrary/, NSLocalizedDescription=PHPhotosErrorBookmarkResolutionFailed, NSUnderlyingError=0x600002832dc0 {Error Domain=com.apple.photos.error Code=41014 (null) UserInfo={NSURL=file:///Users/xxx/Pictures/Photos%20Library.photoslibrary/}}}- Repairing the database doesn't work- mtime's suggestion above doesn't work as Photos only appears briefly in the list of storage options and then vanishesThe console shows errors like:photolibraryd: No SSB on file for <private>photolibraryd: Error creating bookmark data for URL <private> : Error Domain=NSCocoaErrorDomain Code=256 UserInfo={NSDebugDescription=<private>}Photos:Failed to open photo library <private>, Error Domain=com.apple.photos.error Code=41014 UserInfo={NSURL=<private>}Photos:XPC connection error to assetsd <private> :
Topic: App & System Services SubTopic: Core OS Tags:
Jun ’19
Reply to Xcode crash on both Distribute App and Validate App
Previous XCode versions correctly reported the problem without crashing, see:https://stackoverflow.com/questions/41786330/uploading-app-to-app-store-mach-o-header-code-0x72613c21You can check the xcdistributionlogs/IDEDistribution.standard.log2019-03-07 16:34:58 +0000 [OPTIONAL] Didn't find archived user entitlements for <DVTFilePath:0x7f91fdb33e40:'/Users/bruno/Library/Developer/Xcode/Archives/2019-03-07/TEST 07-03-2019, 17.34.xcarchive/Products/Applications/TEST.app/Frameworks/libavdevice.framework'>: Error Domain=NSCocoaErrorDomain Code=4 Item at /Users/bruno/Library/Developer/Xcode/Archives/2019-03-07/TEST 07-03-2019, 17.34.xcarchive/Products/Applications/TEST.app/Frameworks/libavdevice.framework did not contain a archived-expanded-entitlements.xcent resource. UserInfo={NSLocalizedDescription=Item at /Users/bruno/Library/Developer/Xcode/Archives/2019-03-07/TEST 07-03-2019, 17.34.xcarchive/Products/Applications/TEST.app/Frameworks/libavdevice.framework did not contain a archived-expanded-ent
Mar ’19
Reply to Local SwiftData to CloudKit migration
Unresolved error loading container Error Domain=NSCocoaErrorDomain Code=134060 A Core Data error occurred. UserInfo={NSLocalizedFailureReason=Unable to find a configuration named 'default' in the specified managed object model.} It seems that you are hitting a SwiftData bug – When CloudKit integration is enabled, creating a ModelContainer with a migration plan triggers an error. Since WWDC is there, I'd suggest that you try with the latest beta. If the issue is still there, please file a feedback report for the SwiftData team to investigate. For an immediate workaround, you might consider the following flow: Create two model containers, container1 for the local store and container2 for the CloudKit store. For container2, use a configuration name (synced in your case) to differentiate the CloudKit store from the local one, and don't use migration plan, which avoids the error. Migrate the data with your own code, which includes fetching data from container1, transforming it if necessary, and saving the
Jun ’24
Reply to checkResourceIsReachableAndReturnError or fileExistsAtPath for security scoped resources
My standard approach would be to try creating the security-scoped bookmark and see if that fails. I’m presuming that you tried that. What went wrong? Thanks Quinn! Yepp, that's the first thing I tried. It produces a console error: Scoped bookmarks can only be created for existing files or directories Type: Error | Timestamp: 2025-11-18 14:10:18.411061+01:00 | Process: tst_manual_sandboxed_file_access | Library: CoreServicesInternal | Subsystem: com.apple.FileURL | Category: scoped | TID: 0xdd7936 and the bookmarkDataWithOptions call fails with an NSError: Error Domain=NSCocoaErrorDomain Code=260 Scoped bookmarks can only be created for existing files or directories UserInfo={NSURL=file:///Users/torarne/write-single-file2.txt, NSDebugDescription=Scoped bookmarks can only be created for existing files or directories} Which led me to using [NSURL checkResourceIsReachableAndReturnError:] before saving the bookmark. And in turn this forum topic to determine if that's the right approach to handle this use-
Topic: App & System Services SubTopic: Core OS Tags:
Nov ’25
Reply to SwiftData iCloud sync breaks after disabling and re-enabling iCloud
Thanks for the suggestion, @DTS Engineer, I saved the sysdiagnose and filtered it to errors. This is using a basic example project from Xcode. I'm running it on iPhone and Mac and when saving items from iPhone I can see them appear in CloudKit database, but they don't get synced to the Mac. And these are 5 errors that are looping when the Mac is trying to sync (I assume): 1 error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _performSetupRequest:]_block_invoke(1242): : Failed to set up CloudKit integration for store: (URL: file:///Users/admin/Library/Containers/ca.maybelater.SequoiaSync2/Data/Library/Application%20Support/default.store) 2 error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate recoverFromError:](2312): - Attempting recovery from error: 3 Error retrieving daemon to get network transfer endpoint: Error Domain=NSCocoaErrorDomain Code=4099 The connection to service named com.apple.cloudd was invalidated: failed at lookup with error 159 - Sandbox restriction. UserInfo={NSDebugDesc
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’24
Reply to Using UIDocumentPickerViewController for directory, cannot get contentsOfDirectoryAtURL: "Operation Not Permitted"
More information:func documentPicker ( sender:UIDocumentPickerViewController , didPickDocumentAtURL url:NSURL ) { rootURL = url do { var isDir:ObjCBool = false let exists = fileManager.fileExistsAtPath ( rootURL!.path! , isDirectory:&isDir ) print ( Exists: (exists); isDir: (isDir) ) try contents = fileManager.contentsOfDirectoryAtURL ( rootURL! , includingPropertiesForKeys:nil , options:NSDirectoryEnumerationOptions(rawValue:0) ) self.navigationItem.title = rootURL!.lastPathComponent! } catch let error as NSError { print ( Failed to get contents of (rootURL!.path!): (error) ) contents = [] self.navigationItem.title = ... } self.tableView.reloadData() }Exists: true; isDir: true Failed to get contents of /private/var/mobile/Containers/Shared/AppGroup/A497BA66-EA97-4658-BD4B-013ABBBB247A/File Provider Storage/git-ascii-bundle: Error Domain=NSCocoaErrorDomain Code=257 The operation couldn’t be completed. (Cocoa error 257.) UserInfo=0x17026e280 {NSURL=file:///private/var/mobile/Containers/Shared/AppG
Topic: UI Frameworks SubTopic: UIKit Tags:
Sep ’15
Reply to Error JSONSerialization
I am facing similar issue.... Error: underlyingError: Optional(Error Domain=NSCocoaErrorDomain Code=3840 Invalid value around character 0. UserInfo={NSDebugDescription=Invalid value around character 0.} Question I know that using using JSONDecoder we can convert the downloaded JSON data into class/struct object. Is there a way to do the same for raw data(NSData)/octect. Since downloaded is not a json, I am getting error. I have class like this Code public struct FileData: Codable{ public var data: Data? public init (data: Data? = nil){ self.data = data } } Is there a way to assign the downloaded data to FileData().data via decoding extension Data { func decode() -> Result where T: Codable { do { let decoder = JSONDecoder() let object: T = try decoder.decode(T.self, from: self) return Result.success(object) } catch { return Result.failure(error) } } Expectation: Here T is FileData. I using REST Get api to download(octet stream) a file data and want to set it to FileData().data. It seems like raw da
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’21
Reply to In-app purchase fails on Apple Silicon Mac
I'm still facing the issue (despite earlier comment that it's fixed). macOS is up-to-date (macOS 13.1, 22C65) no system updates are available. I cannot refresh the receipt either. I'm always returned the old receipt from just before I upgraded to Ventura. : Finished refreshing receipt with error: Error Domain=ASDErrorDomain Code=500 Failed to write receipt to URL: file:///Users/jeko/Library/Containers/447F8668-DE02-4E43-8350-6AEED8A3408E/Data/StoreKit/sandboxReceipt UserInfo={NSDebugDescription=Failed to write receipt to URL: file:///Users/jeko/Library/Containers/447F8668-DE02-4E43-8350-6AEED8A3408E/Data/StoreKit/sandboxReceipt, NSUnderlyingError=0x6000026f2490 {Error Domain=NSCocoaErrorDomain Code=513 You don’t have permission to save the file “sandboxReceipt” in the folder “StoreKit”. UserInfo={NSFilePath=/Users/jeko/Library/Containers/447F8668-DE02-4E43-8350-6AEED8A3408E/Data/StoreKit/sandboxReceipt, NSUnderlyingError=0x6000026f3720 {Error Domain=NSPOSIXErrorDomain Code=1 Operation not permitted}}
Topic: App & System Services SubTopic: StoreKit Tags:
Mar ’23
Reply to UIFontPickerViewController screen font is broken or black screen issue
When this error message appears, the app also dies. 2 = Error acquiring assertion: (501) personaAttributesForPersonaType for type:0 failed with error Error Domain=NSCocoaErrorDomain Code=4099 The connection to service named com.apple.mobile.usermanagerd.xpc was invalidated: failed at lookup with error 159 - Sandbox restriction. UserInfo={NSDebugDescription=The connection to service named com.apple.mobile.usermanagerd.xpc was invalidated: failed at lookup with error 159 - Sandbox restriction.} Received port for identifier response: <(null)> with error:Error Domain=RBSServiceErrorDomain Code=1 Client not entitled UserInfo={RBSEntitlement=com.apple.runningboard.process-state, NSLocalizedFailureReason=Client not entitled, RBSPermanent=false} elapsedCPUTimeForFrontBoard couldn't generate a task port Received port for identifier response: <(null)> with error:Error Domain=RBSServiceErrorDomain Code=1 Client not entitled UserInfo={RBSEntitlement=com.apple.runningboard.process-state, NSLocalizedF
Topic: UI Frameworks SubTopic: UIKit Tags:
Mar ’24
Reply to An error occurring during Core Data persistent store migration in iOS 13
The same thing is happening to me, migrating at iOS 12 was right at real device and Simulator but at iOS 13 fail with the next log result:SQLite error code:1, 'duplicate column name: ZNAME_OF_THE_COLUMN .... Error Domain = NSCocoaErrorDomain Code = 134110 An error occurred during persistent storage migration.I check the xxxx.sqlite database file in the emulator path before and after the migration and there were no columns with those new same names. To know the route of the *.sqlite in the emulator you have to put a breakpoint and when it is stopped put in the console po NSHomeDirectory(). Then go to Finder window, tap the keys Control + Command + G and paste the route. Yo can handle it (for example) with DB Browser for SQLite program, it´s free.After a long search I have seen what has happened to some people but I have not seen any solution.Mine was:Select the actual *.xcdatamodel.Select Editor > Add Model Version.Provide a version name based on the previous model (like XxxxxxV2.xcdatamodel).Click
Mar ’20
Reply to Swift build tool plugin unable to write to pluginWorkDirectory using Xcode Cloud
We also see this issue, interestingly when Xcode cloud shows the call to run the generated script, the surrounding sandbox-exec does seem to say that writing to this directory should be allowed, yet it still fails: Swift/ErrorType.swift:200: Fatal error: Error raised at top level: Error Domain=NSCocoaErrorDomain Code=513 You don’t have permission to save the file “String+TransactionsAccessors.swift” in the folder “StringsGeneratorPlugin”. UserInfo={NSURL=file:///Volumes/workspace/DerivedData/SourcePackages/plugins/SampleApp.output/SampleApp/StringsGeneratorPlugin/String+TransactionsAccessors.swift, NSUserStringVariant=Folder, NSUnderlyingError=0x600003104330 {Error Domain=NSPOSIXErrorDomain Code=1 Operation not permitted}} then in the call to sandbox-exec /Volumes/workspace/DerivedData/Build/Intermediates.noindex/SampleApp.build/Debug-iphonesimulator/SampleApp.build/Script-7981050304838536995.sh: line 17: 12085 Illegal instruction: 4 /usr/bin/sandbox-exec -p (version 1) (deny default) (import system.
Aug ’23
Reply to SwiftData iCloud sync breaks after disabling and re-enabling iCloud
Well, after a while the other Mac with macOS 15.0.1 stopped syncing too. So the original report is still valid and I can reproduce it on two Macs with 15.0.1 and two iOS devices with iOS 18.1 b7. There is a simple project attached to FB15455847 which fails to sync after disabling / enabling iCloud and adding new items from all devices. Going through sysdiagnose again and following the steps in the article up to Execute the import All previous steps look fine but when it comes to enqueuing the request: default … 14:14:15.841814 … YourCoolApp CloudKit: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _enqueueRequest:]_block_invoke(1003): : enqueuing request: 2D00459F-8C08-4E9A-BC44-FCE1CD29A550 the enqueue fails with this: warning: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _enqueueRequest:]_block_invoke_2(1030): Failed to enqueue request: 7F8489DA-CBB1-47E7-AE6D-EF6F107B1E29 Error Domain=NSCocoaErrorDomain Code=134417 Request ' 7F8489DA-CBB1-47E7-AE6D-EF6F107B1E29' was cancelled because there
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’24
Reply to Drop file not found on MacBook Air
The error persists in the document folder and on the desktop. Here are the logs when droping from the document folder: Unable to open mach-O at path: default.metallib Error:2 ✅ PDF détecté ❌ Échec lors de la copie : Error Domain=NSCocoaErrorDomain Code=4 Le fichier « Facture - Contrôle Technique - Land Rover Defender - 118V.pdf » n’existe pas. UserInfo={NSSourceFilePathErrorKey=/Users/jean-philippegreaux/Documents/Facture - Contrôle Technique - Land Rover Defender - 118V.pdf, NSUserStringVariant=( Copy ), NSDestinationFilePath=/Users/jean-philippegreaux/Library/Containers/jgreaux.gestion-de-comptes/Data/Documents/2025/7/justificatif_89.pdf, NSFilePath=/Users/jean-philippegreaux/Documents/Facture - Contrôle Technique - Land Rover Defender - 118V.pdf, NSURL=file:///Users/jean-philippegreaux/Documents/Facture%20-%20Contro%CC%82le%20Technique%20-%20Land%20Rover%20Defender%20-%20118V.pdf, NSUnderlyingError=0x600001a37ed0 {Error Domain=NSPOSIXErrorDomain Code=2 No such file or directory}} ❌ Échec du traite
Topic: App & System Services SubTopic: Core OS Tags:
Jul ’25
Reply to How to properly use PermissionKit to ask permission
the communication permission work for me with xcode and ios 26.2 public release it needs sync contacts and enable communication limit on the child device. the error messages I got from console were very helpful. (501) Invalidation handler invoked, clearing connection (501) personaAttributesForPersonaType for type:0 failed with error Error Domain=NSCocoaErrorDomain Code=4099 The connection to service named com.apple.mobile.usermanagerd.xpc was invalidated from this process. UserInfo={NSDebugDescription=The connection to service named com.apple.mobile.usermanagerd.xpc was invalidated from this process.} SendFlow (Host): Error sending begin message: hostViewControllerDidActivate(_:) Error Domain=AskToCore.ATMessageComposeValidationError Code=2 Contact syncing is not set up UserInfo={NSLocalizedDescription=Contact syncing is not set up, NSLocalizedFailureReason=Contact syncing needs to be configured before you can send messages., NSLocalizedRecoverySuggestion=Please enable contact syncing in Settings.} S
Dec ’25