Have you done any hacking around on preferences? Is the a sandbox build?
In either case, you should always do:
if the preferences system seems flaky or if you have hacked around on things. See if that clears it up. Restarting would effectively do the same thing too.
I quite the app and then used ActivityMonitor and 'ForceQuit' the 'root' instance and the instance running on the user account.
Re-ran the app and no more of the errors described above. Cool
Have you found our what was the cause of the problem?
It happens to me now, all the time, when I run (debug) from Xcode, my App which is like yours - a simplistic Cocoa app (Document based) with no "extensions" or "groups" or whatever.
It is, though, a sandboxed app (I set up the checkboxes to the best of my understanding, and archive it without diffuculty) but now I get these errors:
2019-09-07 19:49:09.598967+0300 PlanktoMetrix-II[84292:22916507] [User Defaults] Couldn't read values in CFPrefsPlistSource<0x6000000eab80> (Domain: com.apple.PowerManagement, User: kCFPreferencesAnyUser, ByHost: Yes, Container: (null), Contents Need Refresh: Yes): accessing preferences outside an application's container requires user-preference-read or file-read-data sandbox access, detaching from cfprefsd
and I'm wondering what I have done to cause this. My app Does register a set of defaults from a plist resource I have in the app once, upon launch - but that's all. And as much as I can see - nothing related to PowerManagement.
So I've done this (killall prefds as well as explicitly killing the cfprefsd root and user process). I'm working with an iOS app I've ported to mac via catalyst, and I cannot get rid of the messages.
2020-01-07 16:56:48.238531-0800 NetProbe[68038:5897039] [User Defaults] Couldn't write values for keys ( ApplicationAccessibilityEnabled ) in CFPrefsPlistSource<0x600002c13b00> (Domain: com.ap
I get the message for each preference read or write. The app is sandboxed, but has read/write access for both user selected file and downloads folder. What do I need to do?
What is the rest of that domain? It sure looks like it is the start of "com.apple". If so, that's not your domain and you can't access it, at least not from the sandbox.