Search results for

NSCocoaErrorDomain

1,063 results found

Post

Replies

Boosts

Views

Activity

Starting with iOS 13, opening a file in iCloud fails with: Code=256 "The file couldn’t be opened."
Starting with iOS 13 I'm receiving error reports from users that cannot open their iCloud documents anymore. The error is each time: Error Domain=NSCocoaErrorDomain Code=256 The file “Untitled.txt” couldn’t be opened. UserInfo={NSURL=file:///private/var/mobile/Library/Mobile%20Documents/iCloud~com~myapp/Documents/Untitled.txt}Code 256 means: NSFileReadUnknownErrorRestarting the device solves the problem each time, but I get a lot of error reports. My app does check the availability of iCloud documents (it uses file coordination and UIDocument). This used to work fine before iOS 13.Has anybody seen a similar issue? What could be causing this and how could I collect more useful debug information to get to the bottom of this?
2
0
2.5k
Dec ’19
Should I worry about Safari shutting down roughly 30 seconds after building and running my app extension?
I'm in the process of porting over the logic from the background scripts of a Chrome/Firefox web extension to a Safari App Extension. I'm very new to Xcode, so it's taking some time learning how to interpret and confront the issues I'm encountering.I have a test project up and running, my content scripts are getting injected successfully into Safari, and I have updated the messaging logic to account for the different API's used in Safari App Extensions. Dispatching messages back and forth between Swift and Javascript is working. I was just about ready to get into migrating the Javascript logic over to Swift, but after I switched the scheme to my app extension to make use of Xcode's console, errors started appearing and Safari is now closing about 30 seconds after I run the project if I do nothing in the browser. If I click on the extension's toolbar item or setup a timer to dispatch a message to the Safari principle class, the browser will remain open for a few minutes, then eventually closes.Through a ton of
3
0
2k
Dec ’19
macOS Catalina - Current bundle does not have a SystemExtensions directory
I've upgraded my macOS to Catalina. Then I tried to run via Xcode my macOS VPN app (implemented with Packet Tunnel Provider) -The VPN fails to connect and I see at the Console a lot of errors, such as:Current bundle (/Users/myClientPath/Client.app) does not have a SystemExtensions directoryNESMVPNSession[Primary Tunnel:myDetails:(null)]: Received a start command from myClient[2061]Found 0 (0 active) registrations for com.my.bundle.id.extension (com.apple.networkextension.packet-tunnel) - this msgs repeats several timesNEVPNTunnelPlugin(com.my.bundle.id[794]): Validation of the extension failedNESMVPNSession in state NESMVPNSessionStateStarting: plugin NEVPNTunnelPlugin started with PID 0 error (null)Hub connection error: Error Domain=NSCocoaErrorDomain Code=4097 connection to service on pid 0 named com.my.bundle.id.extensiondisposingFailed to start extension com.my.bundle.id.extensionNSDebugDescription=connection to service on pid 0 named com.my.bundle.id.extensionHow can I solve it?
5
0
1.5k
Dec ’19
Reply to What does the error mean: Unable to obtain assetsd XPC proxy
An Apple engineer has provided me the following explanation:The app could not communicate with a helper application (i.e. the photo library). The most common reason that assetsd might crash is because the foreground app is using a lot of memory (or allocating memory very quickly), and the system decides to terminate assetsd to alleviate some of that memory pressure.To prevent these errors, you should make sure that your app is not triggering a high memory pressure situation.This should only be a temporary issue. In other words, if you tried to submit the same request later, it may work (assuming that any high memory pressure situation has been resolved). So, I recommend that you queue up requests that fail and try to submit them later, and inform your user of this in some way, so that they know the save has not gone through yet.This same issue can also create an error with the code 4099, domain NSCocoaErrorDomain and the description:Couldn’t communicate with a helper application.
Dec ’19
Error with initialise of persistent storage since 13.2 - The file “xxx” couldn’t be opened.
Hi,we have app in store, that is frequenty updated and currently up to date - build with latest xCode againts latest SDK. However, there started to appear strange bug just after iOS 13.2. This bug never happens on older iOS.We are using pretty standard function to initialize persistent storage: let storeDescription = NSPersistentStoreDescription() storeDescription.url = databaseDirectory.appendingPathComponent((modelName).sqlite) let container = NSPersistentContainer(name: modelName) container.persistentStoreDescriptions = [storeDescription] container.loadPersistentStores(completionHandler: { (storeDescription, error) in if let error = error as NSError? { Check the error message to determine what the actual problem was. */ fatalError(Core Data initialization error (error), (error.userInfo)) } }) return containerThis code, that worked fine now fails to about 10% of customers - with:crash_info_entry_0 Fatal error: Core Data initialization error: Error Domain=NSCocoaErrorDomain Code=256 The file “Geotag
4
0
2.6k
Dec ’19
How to send mail from app in background
I need to send a mail(s) in the background for my app. What is the best way of doing this? I have tried Mailgun, but hav not got it working. Any tips on what the best/easiest way to send mail in background? Here´s the code I was trying for Mailgun: let parameters = [ from: my@mail.com, to: you@mail.com, subject: Test, text: Testing] let header : HTTPHeaders = [ Authorization: MY-KEY, Content-Type : application/x-www-form-urlencoded] let url = MY-URL AF.request(url, method: .post, parameters: parameters, encoding: URLEncoding.default, headers: header) .responseJSON { response in print(Response: (response)) }This throws the following error:failure(Alamofire.AFError.responseSerializationFailed(reason: Alamofire.AFError.ResponseSerializationFailureReason.jsonSerializationFailed(error: Error Domain=NSCocoaErrorDomain Code=3840 Invalid value around character 0. UserInfo={NSDebugDescription=Invalid value around character 0.})))
1
0
929
Jan ’20
Extension permissions? Does NOT need to read sensitive information
I could not find any way to create an extension with permissions to read the URL without also asking for permission to read the FULL DOM including passwords.A user sent me this screen shot showing an AD BLOCKER that somehow does not read the DOM!My app needs only see the URL, we do NOT read the DOM at all and I don't want to ask for permission to read the entire DOM!The documentation CLEARLY says there is only All Some or Nonehttps://developer.apple.com/documentation/safariservices/safari_app_extensions/safari_app_extension_info_property_list_keys/adjusting_website_access_permissions?language=objcHow does an app NOT ask for permission to read passwords and crazy stuff?Thanks for what must be obvious!This is my first Safari Extensionoh, ok, I guess I can't attach a photo but you get the idea.If I ask for Allowed to be any twitter.com domain, and Some allowed I getError connecting back to host app: NSCocoaErrorDomain, code: 4099Here's my plist XML <?xml version=1.0 encoding=UTF-8?><!DOCTYPE pl
2
0
1.5k
Jan ’20
Reply to tccd process stuck with file system filter
Hello,While checking kernel details , I have seen following logs of sandbox and tccd daemons, please check below:Vnode action for /Library/Application Support/com.apple.TCC/AdhocSignatureCache/F86FE4D8-7544-446E-B7B6-8C2440A00598 in kauth TCCD:Error reading signature from URL: url=/Library/Application Support/com.apple.TCC/AdhocSignatureCache/F86FE4D8-7544-446E-B7B6-8C2440A00598 error=Error Domain=NSCocoaErrorDomain Code=257 The file “F86FE4D8-7544-446E-B7B6-8C2440A00598” couldn’t be opened because you don’t have permission to view it. UserInfo={NSFilePath=/Library/Application Support/com.apple.TCC/AdhocSignatureCache/F86FE4D8-7544-446E-B7B6-8C2440A00598, NSUnderlyingError=0x7fb8b0f22dd0 {Error Domain=NSPOSIXErrorDomain Code=13 Permission denied}}Sandbox: <Our user daemon> (230) System Policy: deny(1) file-read-data /Library/Application Support/com.apple.TCC/AdhocSignatureCache/F86FE4D8-7544-446E-B7B6-8C2440A00598Why sandbox denying to read tccd files ? and open call gets blocked in user mode?T
Topic: App & System Services SubTopic: Core OS Tags:
Jan ’20
NSKeyedUnarchiver not working with simple arrays in Catalina (macOS 10.15)
I have an app that recently started building/running under Catalina and its simple state preservation/restoration code has suddenly stopped working.The code archives an array of custom objects into an NSData blob that gets saved somewhere. Later, that data is decoded back into the array which is used to restore the state.Distilling the problem, I've created the following example:#define SECURE 1 #if !SECURE // The unsecure example UnsecureObject* bonnie = [UnsecureObject new]; bonnie.property = @Bonnie Elizabeth Parker; UnsecureObject* clyde = [UnsecureObject new]; clyde.property = @Clyde Champion Barrow; NSArray<unsecureobject*>* rootObject = @[ bonnie, clyde ]; #endif #if SECURE // Secure example SecureObject* francis = [SecureObject new]; francis.property = @Francis Crick; SecureObject* james = [SecureObject new]; james.property = @ James Watson; NSArray<secureobject*>* rootObject = @[ francis, james ]; #endif // Encode an array of objects into a data blob NSError* error = nil; NSData* data = [
Topic: UI Frameworks SubTopic: AppKit Tags:
2
0
3.9k
Jan ’20
App is crashing upon being given access to the Photo Album on a new simulator instance
I have been developing my app and testing against an iPhone 8 simulator with no problems during the develoopment phase.The app works by taking the user to their photo album when it starts where the user is able to select a photo for editing. Once the user has given access to their photo album the available photos are displayed in a grid.Today I decided to test it running on other simulators (e.g. iPhone 11 Pro). Upon starting, the user is asked to permit sccess to the photo album. Upon giving access, the app crashes. If I then start the app again it works fine.I really don't know what the problem is. The log message seem to indicate a SQLite problem. I am not using SQLite in my code directly.Here's an extract of the start of the log messages I see upon crashing:2020-01-26 12:11:34.728080+0000 BrickArt[3337:420337] [error] error: -addPersistentStoreWithType:SQLite configuration:(null) URL:file:///Users/wayne/Library/Developer/CoreSimulator/Devices/763DCD5F-2F8B-484A-869B-8A0FE88F91CC/data/Media/PhotoData/Photo
0
0
713
Jan ’20
iMessage Not working in Testflight Build
Hello Team,In my current application iMessage is not working fine on Test Flight while it was working fine with AppCentre or hockey build.Please find the Console log for Testflight build whenever I am selecting my app in iMessage.[<private>(<private>)] Hub connection error: Error Domain=NSCocoaErrorDomain Code=4097 connection to service on pid 0 named com.xxxxxx.appname.iMessageExtension UserInfo={NSDebugDescription=connection to service on pid 0 named com.xxxxxx.appname.iMessageExtension}Can you please assist on this?Thanks,
1
0
419
Jan ’20
Reply to iOS Development: Create file failed(return domain:NSCocoaErrorDomain,code:512)
Within NSCocoaErrorDomain, error 512 is NSFileWriteUnknownError, which I’ll admit is not very instructive. In most situations like this the error’s userInfo dictionary contains an NSUnderlyingErrorKey property with more info about the error. Any sign of that here? If you can engage with one of the users hitting this problem, you should ask them to trigger a sysdiagnose log immediately after seeing it. This captures a copy of their system log, which may contain clues as to what’s triggering the problem.You can learn more about sysdiagnose logs from our Bug Reporting > Profiles and Logs page.Share and Enjoy — Quinn “The Eskimo!” Apple Developer Relations, Developer Technical Support, Core OS/Hardware let myEmail = eskimo + 1 + @apple.com
Topic: App & System Services SubTopic: Core OS Tags:
Feb ’20
Reply to iOS Development: Create file failed(return domain:NSCocoaErrorDomain,code:512)
HI, Thanks for your remind, I remove the log。 After search the long log file. I did not see the direct error message in the context of the file creation. So I list the log above my error(The last line of the log is the error log of file creation, It printed by third parrt library CocoaLumberjack ), may it helps. If you need any other message, remind me.2020-02-17 16:31:59.297323 +0800 itunesstored tcp_input [C138.1:3] flags=[S.] seq=2710403315, ack=4213688783, win=8190 state=SYN_SENT rcv_nxt=0, snd_una=4213688782 2020-02-17 16:31:59.297395 +0800 itunesstored nw_flow_connected [C138.1 IPv4#7380eaf2:443 in_progress channel-flow (satisfied (Path is satisfied), interface: pdp_ip0, ipv4, ipv6, dns, expensive)] Transport protocol connected 2020-02-17 16:31:59.297437 +0800 itunesstored boringssl_context_set_handshake_config(1470) [0x10518bec0] set tls_handshake_config_standard 2020-02-17 16:31:59.297439 +0800 itunesstored boringssl_context_set_min_version(324) [0x10518bec0] set 0x0301 2020-02-17 16:31:59.297440 +080
Topic: App & System Services SubTopic: Core OS Tags:
Feb ’20
How to encode/decode [CKRecordZone.ID: CKServerChangeToken]?
public var zonesChangeToken: [CKRecordZone.ID: CKServerChangeToken]? { get { if(backingPreviousZonesChangeToken == nil) { guard let defaults: UserDefaults = UserDefaults(suiteName: CloudKitHandler.APP_GROUP_ID) else { return nil } guard let data = defaults.data(forKey: CloudKitHandler.CK_PREVIOUS_ZONES_CHANGE_TOKEN) else { return [CKRecordZone.ID: CKServerChangeToken]() } do { let unarchiver: NSKeyedUnarchiver = try NSKeyedUnarchiver(forReadingFrom: data) unarchiver.requiresSecureCoding = true backingPreviousZonesChangeToken = try unarchiver.decodeTopLevelObject() as? [CKRecordZone.ID: CKServerChangeToken] } catch { } } return backingPreviousZonesChangeToken } set(value) { backingPreviousZonesChangeToken = value guard let value = value else { return } guard let defaults: UserDefaults = UserDefaults(suiteName: CloudKitHandler.APP_GROUP_ID) else { return } let archiver: NSKeyedArchiver = NSKeyedArchiver(requiringSecureCoding: true) archiver.encode(value) archiver.finishEncoding() defaults.setValue(archiver.enco
1
0
934
Feb ’20
Reply to Xcode notarization and hardened runtime issue
Just use bundlePath and append Contents/Helpers/myProblemExecI'm getting this: Error Domain=NSCocoaErrorDomain Code=4 The file “xmrig” doesn’t exist. I dont think xcode is acutally adding the Helpers folder in the contents folder. Should the folder's location be relative to group? The file definitely exists in my project files, just not in the actual application contents folder?Thanks for clarifying on the code signing stuff.No, it should not be using zsh. Funny enough, i don't actually need to extract data from it, I have another way of making sure it gets its job done. Thanks so much.
Topic: Code Signing SubTopic: General Tags:
Feb ’20