Search results for

NSCocoaErrorDomain

1,063 results found

Post

Replies

Boosts

Views

Activity

XPC service failing to launch from Mac app's framework
Hi! First time using XPC on a Mac app, and I'm stuck on a problem I can't understand. I have an app with multiple frameworks, and I'm adding an XPC service to one of the pre-existing frameworks. Right now the service is just the template that uppercases a string. I took all the necessary steps, I believe (adding the service as a target dependency, and copying it to the XPC Services folder). However, when I run it in Debug mode, I always get: Error Domain=NSCocoaErrorDomain Code=4099 The connection to service named was invalidated: failed at lookup with error 3 - No such process. I also tested on a different, pre-existing framework, and the same thing happens. Here's the weird parts: if I create a new framework and follow exactly the same steps, it works. I've compare the build settings between both frameworks and everything seems similar. And if I run in Release mode, the original service on the problematic framework also works! If I create a project with similar setup (app + framework with service
1
0
1.2k
Jul ’23
Reply to Runtime error when using StoreKit 2
I'm having the same problem and seeing that this question was posted 5 month ago doesn't induce hope to find a fix. The users where able to subscribe, later the app logs a com.apple.storekit [Default] Failed in XPC service while enumerating transactions for IterationType.current: Error Domain=NSCocoaErrorDomain Code=4097 connection to service named com.apple.storekitagent UserInfo={NSDebugDescription=connection to service named com.apple.storekitagent} and purchases are not available anymore. I read that if the user deletes a com.apple.storekitagent folder somewhere and restarts the Mac, it works again but that's not even a good temporary solution.
Topic: App & System Services SubTopic: Core OS Tags:
Jul ’23
The model configuration used to open the store is incompatible with the one that was used to create the store.
I have deleted the app and try to run the Xcode project again. How can I remove this error ? Thread 1: Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=NSCocoaErrorDomain Code=134020 The model configuration used to open the store is incompatible with the one that was used to create the store. UserInfo={NSAffectedObjectsErrorKey=
2
0
1.8k
Jul ’23
Duplicated Signature when archiving a multi platform project
Hey all, I am facing a weird issue when exporting my multi platform project. The project does not make use of the multi platform targets of Xcode yet. For each module in the app there exists two targets, one for iOS and one for watchOS. Each of these targets link agains a binary framework that is imported via SPM. Building works fine but as soon as I want to archive the project at the last step it complains that the Signature for the third party binary framework already exists. Which I think is a valid error message, but it seems to be a bug that the archive process either: Does not override it, which would be reasonable Or it should distinguish between the platforms Or should just not create two signature and just have one signature file created The error message I see “ThirdParty.xcframework.signature” couldn’t be copied to “Signatures” because an item with the same name already exists. Domain: NSCocoaErrorDomain Code: 516 Failure Reason: A file with the name “ThirdParty.xcframework.signature” alre
23
0
7.6k
Jul ’23
SwiftData error 134020 - "The model configuration used to open the store is incompatible with the one that was used to create the store."
Hi all, I have tried everything (that i'm aware of) but i cannot seem to get around this error. My app is setup using only SwiftData and is basically a custom version of the apps shown in SwiftData docs. I have done the following to try to debug: Deleted app from device Clean and re-build Delete derived data and rebuild I have tried reverting changes made to the @Models i have define Every combination of the above steps + rebuilding Im at a loss. No clue how to resolve this. Some weird observations. This error only occurs after the first context.insert call. The first is successful and data is properly persisted across app launches. All subsequent attempts to insert result in the following error: Error Domain=NSCocoaErrorDomain Code=134020 The model configuration used to open the store is incompatible with the one that was used to create the store. UserInfo={NSAffectedObjectsErrorKey= (entity: Track; id: 0x2807a7de0 ; data: { createdAt = 2023-07-02 23:45:45 +0000; name = Test; })}
5
0
2.5k
Jul ’23
Not able to Read or Write to "/Contents/Resource" folder with Xcode 14.3.1
I have my macOS app, which I'm distributing outside the MAC App Store through Notarizing the App. When my end-user unzipped my App (which they downloaded from a shared URL path) and opened it, It crashed after the first time opening (by clicking on the Gatekeeper check popup: Chrome downloaded this file today at 11:10 AM. Apple checked it for malicious software and none was detected. ) In my macOS app (distributing outside the MAC App Store through Notarizing the app), though I removed AppSandbox capability, I am still not able to read/write to the Resource folder. Error ESPlus-2023-06-28-173050_ips.txt Error Domain=NSCocoaErrorDomain Code=513 You don’t have permission to save the file “SupportTextFiles” in the folder “Resources”. UserInfo={NSFilePath=/x.app/Contents/Resources/SupportTextFiles, NSUnderlyingError=0x6000030e3c00 {Error Domain=NSPOSIXErrorDomain Code=1 Operation not permitted}}
1
0
1.1k
Jun ’23
Saving Lists of URLs with Bookmark Data - MacOS
I have been having some issues saving URLs. I want to be able to save a list of URLs with their bookmark data so that the app can still access some folders after reboot. The folders are on the desktop. I have read and write access to the disk, as was set in the app sandbox settings (User Selected File). It works for as long as the app is open but as soon as I restart it the URLs seem to go invalid, or at least it says that I don't have permission to access the folder that is selected. I then have to clear the urls and re-select them. You can ignore the blacklist thing as I am not using it in the tests I am running. You can also ignore the sources_list and dest_list they are for the GUI. Here is how the user selects the file: func inputBrowseClicked(source_or_dest: String) { let inputPanel = NSOpenPanel() if source_or_dest == blacklist { inputPanel.canChooseFiles = true inputPanel.canChooseDirectories = false } else { inputPanel.canChooseFiles = false inputPanel.canChooseDirectories = true } let userChoice = i
4
0
1.2k
Jun ’23
Bakground Assets error: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.apple.backgroundassets.user"
Message failed: -[BAAgentClientProxy currentDownloadsWithCompletion:]_block_invoke error: Error Domain=NSCocoaErrorDomain Code=4097 connection to service named com.apple.backgroundassets.user UserInfo={NSDebugDescription=connection to service named com.apple.backgroundassets.user} The above error occurs when debugging Background Assets on iPhone。
1
0
1.1k
Jun ’23
ASAuthorizationController performRequest returns 4097 error
Hi all, Trying to create a Passkeys registration in my app. This is the implementation I have: ASAuthorizationPlatformPublicKeyCredentialProvider *provider = [[ASAuthorizationPlatformPublicKeyCredentialProvider alloc] initWithRelyingPartyIdentifier:[[jsonDict objectForKey:@rp] objectForKey:@id]]; ASAuthorizationPlatformPublicKeyCredentialRegistrationRequest *request = [provider createCredentialRegistrationRequestWithChallenge: [jsonDict objectForKey:@challenge] name:[[jsonDict objectForKey:@user] objectForKey:@name] userID:[[jsonDict objectForKey:@user] objectForKey:@id]]; ASAuthorizationController *controller = [[ASAuthorizationController alloc] initWithAuthorizationRequests:[NSArray arrayWithObject:request]]; controller.delegate = self; controller.presentationContextProvider = self; [controller performRequests]; But I get this error: Remote proxy object error handler invoked with error: Error Domain=NSCocoaErrorDomain Code=4097 Couldn’t communicate with a helper application. Connection to agent ser
4
0
2.0k
Jun ’23
Permission error occurs when I use setDefaultApplication(at:toOpen:completion:)
I'd like to set my macOS app written in Swift as default app when opening .mp4 file. I think I can do it with setDefaultApplication(at:toOpen:completion:). https://developer.apple.com/documentation/appkit/nsworkspace/3753002-setdefaultapplication However, permission error occurs when I use it. The error is: Error Domain=NSCocoaErrorDomain Code=256 The file couldn’t be opened. UserInfo={NSUnderlyingError=0x6000031d0150 {Error Domain=NSOSStatusErrorDomain Code=-54 permErr: permissions error (on file open)}} I tried to give my app full-disk access, but it didn't work. I also tried to use setDefaultApplication(at:toOpenFileAt:completion:), then it works with no error, but it effects on only one file. What I want to do is to set my app as default app of all .mp4 files. How do I achieve this? My code is like below: let bundleUrl = Bundle.main.bundleURL NSWorkspace.shared.setDefaultApplication(at: bundleUrl, toOpen: .mpeg4Movie) { error in print(error) } Thank you.
3
0
587
Jun ’23
How to prevent folder creation in macOS FileProviderExtension
I need to prevent folder-creation in certain scenarios. I know I can achieve that via NSFileProviderUserInteractions but that only works when folder creation attempt is done via Finder. If however, user tries to create a folder in Terminal via mkdir folder1 then createItem callback does get called. In createItem callback I tried two options: Option 1 func createItem(basedOn itemTemplate: NSFileProviderItem, fields: NSFileProviderItemFields, contents url: URL?, options: NSFileProviderCreateItemOptions = [], request: NSFileProviderRequest, completionHandler: @escaping (NSFileProviderItem?, NSFileProviderItemFields, Bool, Error?) -> Void) -> Progress { let progress = Progress(totalUnitCount: 1) if itemTemplate.parentItemIdentifier == .rootContainer || itemTemplate.contentType == .aliasFile || itemTemplate.contentType == .symbolicLink { print(Preventing item creation in root level) let entry = Entry( id: UUID().uuidString.lowercased(), type: itemTemplate.contentType == .folder ? Entry.Kind.folder : Entry.Ki
2
0
979
Jun ’23
Reply to Help on how to read files names from a directory
There’s something wonky about the code you’re showing. You seem to be calling a function, listDir(dir:), but you’re not showing the definition of that function. Regardless, you won’t be able to achieve your goal. Swift Playgrounds runs your app is a sandbox and that sandbox prevents access to most stuff on the user’s hard disk. Consider this snippet: import Foundation let fileManager = FileManager.default let libDir = try fileManager.url(for: .libraryDirectory, in: .userDomainMask, appropriateFor: nil, create: true) print(libDir.path) It prints: /Users/quinn/Library/Containers/com.apple.PlaygroundsMac.ExecutionExtension/Data/Library which is the library directory associated with your sandbox. Now consider this: import Foundation let fileManager = FileManager.default let realLibDir = URL(fileURLWithPath: /Library/Logs/DiagnosticReports) do { let contents = try fileManager.contentsOfDirectory(at: realLibDir, includingPropertiesForKeys: nil) print(contents) } catch { print(error) } It fails with: Error Domain=NSCocoaErrorDomain
Topic: App & System Services SubTopic: Core OS Tags:
May ’23
iOS-on-macOS app receipt not saved in recent macOS versions
Dear All, My iOS app used to work OK on macOS, but since a macOS update in-app purchases have stopped working. It seems that the storekitagent process is no longer able to save the receipt to the filesystem. Here is what I see in the system log after I do a refresh receipt: default 22:03:47.822657+0100 storekitagent [58C16E76_SK1] Writing receipt (83905 bytes) to file:///Users/phil/Library/Containers/0407ACA7-9EE2-4E32-AA3E-101A1B38EE70/Data/StoreKit/sandboxReceipt error 22:03:47.823539+0100 kernel Sandbox: storekitagent(1382) deny(1) file-write-unlink /Users/phil/Library/Containers/0407ACA7-9EE2-4E32-AA3E-101A1B38EE70/Data/StoreKit/sandboxReceipt error 22:03:47.824306+0100 storekitagent [58C16E76_SK1] Error writing receipt (83905 bytes) to file:///Users/phil/Library/Containers/0407ACA7-9EE2-4E32-AA3E-101A1B38EE70/Data/StoreKit/sandboxReceipt: Error Domain=NSCocoaErrorDomain Code=513 You don’t have permission to save the file “sandboxReceipt” in the folder “StoreKit”. UserInfo={NSFilePath=/Users/phil
3
0
961
May ’23
Unable to initialize without a valid iCloud account
Building an app with iCloudKit integration. Build is successful but Simulator crashes with above error. I have an active developer account, have configured the app for iCloudKit integration in Signing and Capabilities, have logged into Xcode with my account as well as on the Simulator so I think I have all requirements completed correctly but app still crashes. Error Domain=NSCocoaErrorDomain Code=134400 Unable to initialize without a valid iCloud account (CKAccountStatusTemporarilyUnavailable). UserInfo={NSLocalizedFailureReason=Unable to initialize without a valid iCloud account (CKAccountStatusTemporarilyUnavailable).} Not sure why my account status in temporarily unavailable. Any help would be much appreciated.
0
0
952
May ’23
Field '___modTime' is not marked sortable
I'm using NSPersistentCloudKitContainer and I'm getting warnings in the console saying: CoreData: CloudKit: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _scheduleAutomatedExportWithLabel:activity:completionHandler:]_block_invoke(3457): - Finished automatic export - AppActivationExport - with result: storeIdentifier: F2C60E7A-CEC4-44F2-B467-7324C065AD33 success: 0 madeChanges: 0 error: Error Domain=NSCocoaErrorDomain Code=134406 Request '1FA53D40-43FB-4751-8719-0D26393D5301' was aborted because the mirroring delegate never successfully initialized due to error: UserInfo={NSLocalizedFailureReason=Request '1FA53D40-43FB-4751-8719-0D26393D5301' was aborted because the mirroring delegate never successfully initialized due to error: } I have added indexes for recordName and modifiedTimestamp to all my records as queryable as per the instructions.
2
0
1k
May ’23