iOS 10: Failed to read values in CFPrefsPlistSource

I've updated my Xcode 8 to beta 2 today and I'm trying to share data between App and Today Extension. I'm facing with this log warning:



2016-07-08 18:00:24.732472 ProjetctX[941:42801] [User Defaults] Failed to read values in CFPrefsPlistSource<0x1700f1280> (Domain: group.x.p.t.o, User: kCFPreferencesAnyUser, ByHost: Yes, Container: (null)): Using kCFPreferencesAnyUser with a container is only allowed for System Containers, detaching from cfprefsd



Anyone can help me?

Post not yet marked as solved Up vote post of klevison Down vote post of klevison
42k views

Replies

I'm having the same issue. Did you get this sorted out?


I'm also trying to share data between my app and today extension targets via

UserDefaults
/ app groups.

I'm seeing the same thing. Did anyone find a workaround?

I still see this warning in beta 3, but as far as I can tell, as long as the app group config is correct the functionality still works - i.e. I can get/put settings with both the app and extension and both can see what the other did.

Seeing similiar issues. Trying to share information between an iMessage Extension, and my App.

I'm still seeing this in beta 3. When the extension is first launched, I cannot read user defaults from the app group at all - but if I try again later, sometimes I'm able to read the values written to the defaults. I'm seeing this in the iPhone app as well - sometimes when I launch the app, the user defaults from the app group just aren't there, but if I relaunch the app then they reappear.


Submitted a radar: 27582964

I'm seeing this still with XCode 8 beta 4.


Things have been working fine despite the warning, however now my phone extension has stopped working when trying to access the shared defaults.

I have the same issue on Xcode beta 4.

Although Today extension and the application can share user defaults most of the times, it sometimes fails ( changes in Today extension sometimes do not take effects on the shared defautls.)


Also synchronize always returns 'false', but actually it succeeds mostly.

  let ud = UserDefaults(suiteName: "APP GROUP IDENTIFIER")
  if ud?.synchronize() != true { 
 // synchronize() always fails
  }

I'm having the same issue. It's occuring on my device so it doesn't seem to be a Simulator issue (as I've seen other threads say).

I have same issue on device (Apple Watch) only, not happening on sim with XCode 8b5.


Greg

I'm having this issue too. XCode 8b6(8S201h) with an iMessage Extension

I also have this issue, too. Xcode8 beta6. with Siri

I have the same problem. Impossible to work on my app now 😟

Same here for a 10.12 Mac app, crashes at launch. Can't work! Latest 10.12 beta didn't fix it either. What might be the problem?

It seems after I disabled all my Handoff related code in the app, the app suddenly started working again without throwing this error! Not sure why but for now at least I can continue after days of waiting for Apple to fix.

+1


I'm running Xcode 8 Beta 6 and iOS 10 Beta 8 and have the application group properly set on both iOS container app and notification container extension. The app is built and signed properly.


Running the app on device results in the following error when I try to either read or write to a NSUserDefaults instance instantiated with initWithSuiteName:


[User Defaults] Failed to read values in CFPrefsPlistSource<0x1742fba00> (Domain: xxxx, User: kCFPreferencesAnyUser, ByHost: Yes, Container: (null)): Using kCFPreferencesAnyUser with a container is only allowed for System Containers, detaching from cfprefsd

If I am writing then I get the following additional error:


[User Defaults] Attempt to set a non-property-list object {

8400 = 1;

} as an NSUserDefaults/CFPreferences value for key kUserDefaultsFeatureTrackingKey


However the object I am writing to NSUserDefaults is a standard NSDictionary with NSNumber as key and NSString as value.


Did anyone succeed in getting NSUserDefaults with App Groups working properly on iOS 10?


Thanks!