Search results for

NSCocoaErrorDomain

1,063 results found

Post

Replies

Boosts

Views

Activity

iOS 17 beta "You don’t have permission to save the file" crash on device
Issue This issue is reproducible on iOS 17 beta 4 and iOS 17.0 (21A5303d) public beta. When try to create a folder using the FileManager API, the app crashes with the following stack trace. Thread 1: Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=NSCocoaErrorDomain Code=513 You don’t have permission to save the file “Samples” in the folder “…”. UserInfo={NSURL=file://…/Samples.app/, NSUnderlyingError=0x28100cf00 {Error Domain=NSPOSIXErrorDomain Code=1 Operation not permitted}} What is the user impact? Users will not be able to run the app on iOS 17 Steps to Reproduce Create a new project Add the following code import SwiftUI struct ContentView: View { var body: some View { Text(Hello, world!) .onAppear { _ = makeTemporaryDirectory() } } /// Creates a temporary directory. private func makeTemporaryDirectory() -> URL { try! FileManager.default.url( for: .itemReplacementDirectory, in: .userDomainMask, appropriateFor: Bundle.main.bundleURL, create: true ) } } Build and run t
5
0
3.7k
Aug ’23
The download failed, what are the requirements for the BackgroundDownloadExt certificate or BundleId?
xcrun backgroundassets-debug --simulate --app-install -d 00008120-0014188636D8C01E -b com.testBackGround.photos Application was installed event was sent for app identifier: (com.testBackGround.photos). WWDC Sessions Background Assets Extension container_create_or_lookup_app_group_path_by_app_group_identifier: client is not entitled backgroundassets.user Extension interrupted for identifier: com.testBackGround.photos runningboardd Invalidating assertion 31-413-2850 (target:[xpcservice:413])>:1479]) from originator [osservice:413] backgroundassets.user Extension invalidated for identifier: com.testBackGround.photos backgroundassets.user Extension for app identifier com.testBackGround.photos ran for 1.1 seconds. backgroundassets.user Failed to send -[BADownloaderExtensionProxy requestDownloadsWithContentRequest:manifestURL:extensionInfo:completion:]_block_invoke for: com.testBackGround.photos error: Error Domain=NSCocoaErrorDomain Code=4099 The connection to service named com.testBackGround.photos.Ba
2
0
1.1k
Aug ’23
File download failed
Failed to send -[BADownloaderExtensionProxy backgroundDownload:finishedWithSandboxToken:completionHandler:]_block_invoke for: com.xuhuiTest.photos error: Error Domain=NSCocoaErrorDomain Code=4097 connection to service with pid 2085 named com.xuhuiTest.photos.BackgroundDownloadExt UserInfo={NSDebugDescription=connection to service with pid 2085 named com.xuhuiTest.photos.BackgroundDownloadExt} Client is missing signing identifier, client must be signed with an identifier to use BackgroundAssets. (null) log.json
2
0
993
Aug ’23
backgroundassets download failed
xcrun backgroundassets-debug --simulate --app-install -d 00008120-0014188636D8C01E -b com.linkone.photos Application was installed event was sent for app identifier: (com.linkone.photos). 1.Failed to get LSApplicationRecord for :432])>; Launching extension com.linkone.photos.BackgroundDownloadExt(417909C8-350A-40DB-BB09-011C6852A5F9) for host 432> with error Error Domain=NSOSStatusErrorDomain Code=-10814 (null) UserInfo={_LSLine=1569, _LSFunction=runEvaluator} 2.Extension interrupted for identifier: com.linkone.photos 3.Failed to send -[BADownloaderExtensionProxy requestDownloadsWithContentRequest:manifestURL:extensionInfo:completion:]_block_invoke for: com.linkone.photos error: Error Domain=NSCocoaErrorDomain Code=4099 The connection to service named com.linkone.photos.BackgroundDownloadExt was invalidated from this process. UserInfo={NSDebugDescription=The connection to service named com.linkone.photos.BackgroundDownloadExt was invalidated from this process.} 4.Removing manifest download as e
2
0
1k
Aug ’23
Reply to How to activate NEPacketTunnelProvider?
While still working on write to file, I'm running into this issue now. Error Domain=NSCocoaErrorDomain Code=513 UserInfo={NSFilePath=, NSUnderlyingError=0x600000c782a0 {Error Domain=NSPOSIXErrorDomain Code=1}}. I read the thread https://developer.apple.com/forums/thread/63075 and added .noFileProtection to my write method call, but that didn't fix the issue. Since the network extension works as root to write to file and I want to write to /private/tmp/example.txt, why am I seeing this error?
Aug ’23
Reply to CoreData: warning: CoreData+CloudKit
I have the same problem and my app is being rejected by Apple. I could not replicate the crash but I get crash report. the only clue is the warning message in the console: CoreData: warning: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _performSetupRequest:]_block_invoke(1093): : Successfully set up CloudKit integration for store (1F2E3F9B-9DD9-4D61-9DB9-ADD2A3DE9D8D): (URL: file:///var/mobile/Containers/Data/Application/AAF688C5-D8C2-4A5E-A87D-B6F04537A941/Library/Application%20Support/shared.sqlite) CoreData: warning: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _enqueueRequest:]_block_invoke_2(990): Failed to enqueue request: 82E677A0-8E75-470A-A5CC-59BBC6C53D38 CoreData: warning: CoreData+CloudKit: -[NSCloudKitMirroringDelegate finishedAutomatedRequestWithResult:](3372): Finished request ' 82E677A0-8E75-470A-A5CC-59BBC6C53D38' with result: storeIdentifier: 0811C705-3EB2-4C73-BC5B-B96B43E4F2E0 success: 0 madeChanges: 0 error: Error Domain=NSCocoaErrorDomain Code=134417 Request ' 82E677A
Aug ’23
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
Error on writing with AVAssetExportSession with iOS 17.0 (21A5291h), works fine in IOS 16
I have these code snippets to take an existing video file, write one additional track to it and then write the result to a new file. let movie = AVMovie(url: fromFileUrl) let mutableMovie = movie.mutableCopy() as! AVMutableMovie (removed some code here that adds another track to the mutableMovie) let exporter = AVAssetExportSession( asset: mutableMovie, presetName: AVAssetExportPresetPassthrough ) exporter!.outputFileType = .mov exporter!.outputURL = newFilePath exporter!.exportAsynchronously {... This works great up to IOS 16, but from IOS 17 beta I get the following errors in the console of XCODE 15 beta 5 <<<< AVAsset >>>> +[AVURLAsset _getFigAssetCreationOptionsFromURLAssetInitializationOptions:assetLoggingIdentifier:figAssetCreationFlags:error:]: AVURLAssetHTTPHeaderFieldsKey must be a dictionary <<<< AVError >>>> AVLocalizedErrorWithUnderlyingOSStatus: Returning error (NSCocoaErrorDomain / 257) status (-12 203) The export then fails with the follo
4
0
1.1k
Jul ’23
Terrible performance when using MusicKit's Artwork with UIKit
I'm building a UIKit app that reads user's Apple Music library and displays it. In MusicKit there is the Artwork structure which I need to use to display artwork images in the app. Since I'm not using SwiftUI I cannot use the ArtworkImage view that is recommended way of displaying those images but the Artwork structure has a method that returns url for the image which can be used to read the image. The way I have it setup is really simple: extension MusicKit.Song { func imageURL(for cgSize: CGSize) -> URL? { return artwork?.url( width: Int(cgSize.width), height: Int(cgSize.height) ) } func localImage(for cgSize: CGSize) -> UIImage? { guard let url = imageURL(for: cgSize), url.scheme == musicKit, let data = try? Data(contentsOf: url) else { return nil } return .init(data: data) } } Now, everytime I access .artwork property (so a lot of times) the main thread gets blocked and the console output gets bombared with messages like these: 2023-07-26 11:49:47.317195+0200 Plum[998:297199] [Artwork] Failed to cre
5
0
1.6k
Jul ’23
Background Assets Failed to move manifestURL to APP group
After receiving manifestURL in extension, I try to move it to the shared directory of APP group, as follows: NSURL *url = [NSFileManager.defaultManager containerURLForSecurityApplicationGroupIdentifier:self.appGroupIdentifier]; NSURL *storageURL = [url URLByAppendingPathComponent:@YYBAResCache isDirectory:YES]; BOOL isDirectory; BOOL isExists = [NSFileManager.defaultManager fileExistsAtPath:storageURL.path isDirectory:&isDirectory]; NSError *error = nil; if (!isExists || !isDirectory) { [NSFileManager.defaultManager createDirectoryAtURL:storageURL withIntermediateDirectories:YES attributes:@{NSFilePosixPermissions: [NSNumber numberWithShort:0777]} error:&error]; } if (error){ NSLog(@Failed to create session storage directory:%@,error); } NSURL *localManifestURL = [sessionStorageURL URLByAppendingPathComponent:@manifest.json]; Next, move the file: NSError *error; [NSFileManager.defaultManager moveItemAtURL:manifestURL toURL:localManifestURL error:&error]; if (error) { NSLog(@BackgroundAssetsTest ex
1
0
934
Jul ’23
Reply to TTSPlugins doesn't exist in Xcode Version 15.0 beta 4 (15A5195m)
My message was clipped, here is initial error: Speech Error: Error Domain=NSCocoaErrorDomain Code=260 The folder “TTSPlugins” doesn’t exist. UserInfo={NSUserStringVariant=( Folder ), NSFilePath=/Library/Developer/CoreSimulator/Volumes/iOS_21A5277g/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.0.simruntime/Contents/Resources/RuntimeRoot/System/Library/TTSPlugins, NSUnderlyingError=0x600000c72fa0 {Error Domain=NSPOSIXErrorDomain Code=2 No such file or directory}}
Topic: App & System Services SubTopic: Core OS Tags:
Jul ’23
Why does NSAttributedString's NSItemProviderWriting implementation not transfer custom attributes that implement Codable?
I am working on supporting some formatted text editing in my app, and I've been experimenting with copy and paste support for formatted text. I discovered that NSAttributedString implements NSItemProviderWriting, which means I can give it to UIPasteboard via setObjects and all the built-in attributes transfer perfectly if I then paste it into another text view, or even another app that behaves itself. But if I have custom attributes in my attributed string, having their values implement Codable doesn't let them transfer across the clipboard. In my implementation of textPasteConfigurationSupporting(_: transform:), I try to get an attributed string like this: let attr = item.itemProvider.loadObject(ofClass: NSAttributedString.self) { val, err in //...handle here } I get an error like this: Error Domain=NSItemProviderErrorDomain Code=-1000 Cannot load representation of type com.apple.uikit.attributedstring UserInfo={NSLocalizedDescription=Cannot load representation of type com.apple.uikit.attributedstring, NSUnd
1
0
1.1k
Jul ’23
Can't debug ILMessageFilterExtension
I have an application that filters messages using ILMessageFilterExtension. I have app groups set up and sertificates/profiles. The filtering worked a couple of months ago, but recently I noticed that I can't debug the extension( ILMessageFilterExtension's init() didn't called). When I connect to the Messages process, I get the following errors. What could be the problem? 2023-07-17 19:52:31.450808+0200 MobileSMS[2344:373404] [ServerBag] Checked bag access permission -- allowed? YES {self: , hasMachAccess: YES, hasEntitlements: YES} 2023-07-17 19:52:31.498361+0200 MobileSMS[2344:373407] [AppConfiguration] [com.apple.MobileSMS:F297CBA2-105E-4D38-9EB1-BB09500B39C7] Error when getting current app configuration for action identifier ConversationListFocusFilterAction, error='Error Domain=DNDErrorDomain Code=1007 No current action is available. Supply the caller with the default. UserInfo={NSLocalizedDescription=No current action is available. Supply the caller with the default.}' 2023-07-17 19:52:31.545894+0200 Mo
1
0
1.3k
Jul ’23
Reply to Use WeatherKit in an Xcode playground?
Update: This code does not crash the app, and the error returned hints that I might have an access issue. I'm still wondering if this is even possible in a playground. As an aside, I have successfully used Apple's Flight Planner app that is offered as a WeatherKit demo. So my account seems to be authorized or whatever the word is. import UIKit import WeatherKit import CoreLocation let sanFrancisco = CLLocation(latitude: 37.7749, longitude: 122.4194) do { let weather = try await WeatherService().weather(for: sanFrancisco) } catch { print(error) } This produces the error: xpcConnectionFailed(Error Domain=NSCocoaErrorDomain Code=4097 connection to service named com.apple.weatherkit.authservice UserInfo={NSDebugDescription=connection to service named com.apple.weatherkit.authservice}) Playground execution failed: error: execution stopped with unexpected state. error: Execution was interrupted. The process has been left at the point where it was interrupted, use thread return -x to return to the state bef
Jul ’23
Can no longer share files to app
I have an iOS/iPadOS app that has the ability to open files by using the Share action in the Files app. The app receives the application:openURL:options: method, but when it tries to access the given url, it produces this error: Error Domain=NSCocoaErrorDomain Code=257 The file “Zippy.cbz” couldn’t be opened because you don’t have permission to view it. UserInfo={NSURL=file:///private/var/mobile/Containers/Shared/AppGroup/B1C0C77A-2E86-4BD7-9344-845D6DA6FA74/File%20Provider%20Storage/Zippy.cbz, NSFilePath=/private/var/mobile/Containers/Shared/AppGroup/B1C0C77A-2E86-4BD7-9344-845D6DA6FA74/File Provider Storage/Zippy.cbz, NSUnderlyingError=0x283c6d860 {Error Domain=NSPOSIXErrorDomain Code=1 Operation not permitted}} This used to work in earlier versions of iPadOS. It's currently running 16.5.1 ©. I see AppGroup in the path. Does that mean that something thinks my app is using a shared app group? It's not. Does it need to now in order to receive a shared file?
0
0
613
Jul ’23