In case this helps someone diagnosing, or running into the same issue.
I could not figure out what is triggering this, but wiping the Xcode configuration fixed this for me.
Backup your configuration like this:
defaults read com.apple.dt.Xcode backup.defaults
Then remove all the settings:
defaults delete com.apple.dt.Xcode
Post
Replies
Boosts
Views
Activity
Hello,
Thanks Bmalbuck - I discovered this just today, and came back to update folks on that, and saw your response.
It does seem like the bug is bound to the relative ~/DerivedData.
This is very odd, a new project does not exhibit this problem.
This is happening to my open source library:
https://github.com/migueldeicaza/SwiftTerm
In project TerminalApp/iOSTerminal.xcodeproj
Thank you, this did indeed get me over this odd crash.
I have run into another issue, and I can not seem to be making any progress, despite my attempts at single-stepping into the FileProvider framework with little luck.
I explored a couple of options:
Default scaffolding
I took the default scaffolding produced by Xcode, and merely added the NSFileProviderManager.add on my main application. In this scenario, when I try to run the extension, my constructor required init(domain: NSFileProviderDomain) is never invoked. But I do get the following messages on the console:
2022-07-13 09:48:41.519607-0400 Gooble[11689:275870] [org.tirania.test.swiftui.Third.Gooble/N{35}r] [ERROR] Creating internal error for "itemForItemID", original error was: NSError: FP -1000 "You need to authenticate before accessing this item."
2022-07-13 09:48:41.524792-0400 Gooble[11689:275869] [org.tirania.test.swiftui.Third.Gooble/N{35}r] [ERROR] Creating internal error for "fetchAndStartEnumeratingWithSettings", original error was: NSError: FP -1000 "You need to authenticate before accessing this item."
I have tried to use breakpoints and abort() everywhere to try to catch this thing, I tried using dtrace after disabling system integrity protection, and looked the Console logs and nothing seems unusual about it:
default Gooble Hello, I'm launching as euid = 501, uid = 501, (persona not available)
default Gooble Initializing connection
default Gooble Removing all cached process handles
default Gooble Sending handshake request attempt #1 to server
default Gooble Creating connection to com.apple.runningboard
default Gooble Handshake succeeded
default Gooble Identity resolved as xpcservice<org.tirania.test.swiftui.Third.Gooble([osservice<com.apple.FileProvider>:11146])>
default Gooble Bootstrapping; Bootstrap complete. Ready for handshake from host.
default Gooble [u 74075900-B5F2-4A1A-8E9F-0FE0A8E0380C] [(null)((null))] Prepare received as euid = 501, uid = 501, (persona not available)
default Gooble [u 9207AE37-8A25-49EB-A34A-E08DFB9A197A] [org.tirania.test.swiftui.Third.Gooble(1.0)] Set sole personality.
default Gooble [u 9207AE37-8A25-49EB-A34A-E08DFB9A197A] [org.tirania.test.swiftui.Third.Gooble(1.0)] Begin using received as euid = 501, uid = 501, (persona not available)
default Gooble +[NSExtensionContext _allowedItemPayloadClasses] not implemented. Setting the allowed payload classes to {(
NSO
)}
default Gooble Start service name com.apple.spotlight.IndexDelegateAgent
error Gooble [ERROR] Creating internal error for "itemForItemID", original error was: NSError: FP -1000 "You need to authenticate before accessing this item."
error Gooble [ERROR] Creating internal error for "fetchAndStartEnumeratingWithSettings", original error was: NSError: FP -1000 "You need to authenticate before accessing this item."
default Gooble [u 9207AE37-8A25-49EB-A34A-E08DFB9A197A] [org.tirania.test.swiftui.Third.Gooble(1.0)] Removed sole personality.
default Gooble [u 9207AE37-8A25-49EB-A34A-E08DFB9A197A] [org.tirania.test.swiftui.Third.Gooble(1.0)] host connection from pid 11146 invalidated
Changing the base class
I modified the sample to subclass NSFileProviderExtension instead of NSObject, and with this, my breakpoint on the constructor is hit, but still, none of my methods are called. The Xcode console shows a similar result to the previous version - makes me suspect that there is something missing that prevents my code from being invoked that is not hooked up.
This was the reason I started to use dtrace in the first place, as the "The file couldn't be opened" sounded like a good candidate to find what was missing, but I can not find any suspicious attempts to access the file system in that case:
2022-07-13 09:58:25.646358-0400 Gooble[12084:288057] [org.tirania.test.swiftui.Third.Gooble/N{35}r] [ERROR] Creating internal error for "itemForItemID", original error was: NSError: Cocoa 256 "The file couldn’t be opened."
2022-07-13 09:58:25.652024-0400 Gooble[12084:288059] [org.tirania.test.swiftui.Third.Gooble/N{35}r] [ERROR] Creating internal error for "fetchAndStartEnumeratingWithSettings", original error was: NSError: Cocoa 3328 "The requested operation couldn’t be completed because the feature is not supported."
The output from the Console app:
default Gooble Hello, I'm launching as euid = 501, uid = 501, (persona not available)
default Gooble Initializing connection
default Gooble Removing all cached process handles
default Gooble Sending handshake request attempt #1 to server
default Gooble Creating connection to com.apple.runningboard
default Gooble Handshake succeeded
default Gooble Identity resolved as xpcservice<org.tirania.test.swiftui.Third.Gooble([osservice<com.apple.FileProvider>:11146])>
default Gooble Bootstrapping; Bootstrap complete. Ready for handshake from host.
default Gooble [u C81493C9-173C-43F5-8C30-BF24B6AB36F7] [(null)((null))] Prepare received as euid = 501, uid = 501, (persona not available)
default Gooble [u 118918F0-BAB7-4945-9770-C0AD353BF587] [org.tirania.test.swiftui.Third.Gooble(1.0)] Set sole personality.
default Gooble [u 118918F0-BAB7-4945-9770-C0AD353BF587] [org.tirania.test.swiftui.Third.Gooble(1.0)] Begin using received as euid = 501, uid = 501, (persona not available)
default Gooble +[NSExtensionContext _allowedItemPayloadClasses] not implemented. Setting the allowed payload classes to {(
NSObject
)}
default Gooble NotifyToken::RegisterDispatch(com.apple.LaunchServices.database) fired for session key LSSessionKey(system: 0 uid: 501)
default Gooble Start service name com.apple.spotlight.IndexDelegateAgent
error Gooble [ERROR] Creating internal error for "itemForItemID", original error was: NSError: Cocoa 256 "The file couldn’t be opened."
error Gooble [ERROR] Creating internal error for "fetchAndStartEnumeratingWithSettings", original error was: NSError: Cocoa 3328 "The requested operation couldn’t be completed because the feature is not supported."
default Gooble [u 118918F0-BAB7-4945-9770-C0AD353BF587] [org.tirania.test.swiftui.Third.Gooble(1.0)] Removed sole personality.
default Gooble [u 118918F0-BAB7-4945-9770-C0AD353BF587] [org.tirania.test.swiftui.Third.Gooble(1.0)] host connection from pid 11146 invalidated
Mhm, I just noticed something that I missed previously, which might be the whole reason for the above not working.
The call to NSFileProviderManager.add (domain) is returning an error NSPOSIXErrorDomain Code=1 "Operation not permitted", but still manages to add my file provider to Files. And shortly after the console shows:
[unspecified] container_create_or_lookup_app_group_path_by_app_group_identifier: client is not entitled
I have made sure they both are on the same app group (had to add the app group manually to the containing application, and it matches the extension provider).
This seems to be only a problem on the simulator, and not on the device. I got the baseline to work on device, the same code on simulator produces the Operation Not Permitted issue.
This happens to me with a project that uses a couple of external SwiftPM, no XIB files.
As described, every other build this gets triggered. Sometimes you get one error of that kind, sometimes, 4 or 5. A rebuild clears it, but is a lot of wasted time.
That works, but two convenience features seem to be gone.
The first is that replacing a package was a matter of dragging the new package Xcode's project navigator, and it would automatically override the current definition (no need to delete) and when you were done, you could remove it, and it would automatically revert back to the configuration you had.
The workaround requires the original package definition to be entered again (was it a hash, was it a version range, was it just a branch?)
Thank you so much! This is great!
I am having the same problem this morning.
Having the same issues, heavy on Tuesday, worked for a bit yesterday, today it is the same problem.
If you manage to login without being logged back out immediately, you are greeted with empty pages that spin without updating.
Having the exact same problem.