App crashes on iOS 11 Beta 4 because of SymptomAnalytics private framework Event object

My app crashes because we used a class name of "Event" and Apple introduced this class in iOS 11 Beta in the SymptomAnalytics private framework. I'm hoping Apple may fix this by renaming their object. I mean "Event" is a pretty common name and this might cause a lot of App Store developers problems.


Our line of code:


_events = [NSKeyedUnarchiver unarchiveObjectWithFile:@"events.plist"]];


Which unarchives our an array of Event object causes this error to be thrown:


objc[1002]: Class Event is implemented in both /System/Library/PrivateFrameworks/Symptoms.framework/Frameworks/SymptomAnalytics.framework/SymptomAnalytics (0x1b1fac1d0) and /var/containers/Bundle/Application/XXXXXX/XXXXX.app. One of the two will be used. Which one is undefined.

Apple has long recommened that developers use three character class prefixes in Objective-C, specifically to avoid this sort of conflict.


Programming with Objective-C

Coding Guidelines for Cocoa


Xcode will even automatically add your class prefix to the begining of file names for you as you create them. Just add one to the Project Document settings in the Inspector. For existing projects you can use the refactor tools to rename the classes to compliant ones.


Swift does not require the class prefixes because of the way it handles the namespaces.

Thanks dubs for your response and that makes sense. Can you also share this with the SymptomAnalytics framework team? (ex: Renaming the Event object to SAEvent to avoid conflicts) Seems like it was just added to Beta 4 and maybe it was just an oversight on the naming of the class.


Do you have any advice how we can rename our Event class while maintaining backwards compatibility with data that has already been serialized with NSKeyedArchiver? The class name is serialized along with the data and I'm not sure if there is a way to remap it when unarchiving.

Thanks again.

My app has the same problem. We used a class name of "Event" to cause a crash on iOS 11 Beta4. I agree with iTodd, (I'm hoping Apple may fix this by renaming their object. I mean "Event" is a pretty common name and this might cause a lot of App Store developers problems).

I would encourage any developer running into this issue to file bugs on it so that the impact is known.

Hi dubs, thanks for the reply.


I have the same problem. Starting with iOS 11 beta 4 SymptomAnalytics conflicts with my Core Data. I have "Event" table and classes Event+CoreDataProperties.h and Event+CoreDataPropertiesI.m

On the launch app crashes because I'm syncing new events with the server. And I get this message "Class Event is implemented in both /System/Library/PrivateFrameworks/Symptoms.framework/Frameworks/SymptomAnalytics.framework/SymptomAnalytics (0x1b59081d0) and /var/containers/Bundle/Application...."

I originally released the app back in 2013, and Event table has been in my Core Data since the day one. I have several million users who can potentially suffer from not being able to access their health data. Early adopters of beta 4 are already sending me tons of angry emails and I barely have time to reply. Is there a change Apple will fix on the their side? Or should I change my Code Data and release an update to avoid a disaser when GM is released?

I have the same problem with Event being an NSManagedObject subclass since our app was launched in 2011. We have many users whose app will stop working once they update to iOS 11, even if we have a fixed version available in the App Store (not everyone regularly updates their app version to be the latest because we don't hassle users to update like the iOS system does, and the existing app will stop working on iOS 11 and start crashing for them).


Event is definitely a very common symbol name in a variety of systems that might appear in an iOS app, and despite the recommendations in the coding guidelines it's not really acceptable for a private framework to take ownership of a commonly used symbol like "Event" and prevent any app from declaring it as something. We don't have any control of the private framework and it's not something that we have intentionally included. Agree with iTodd that the one in the private frameworkd should be declared SAEvent or similar, to match expectations.


I've filed a bug report for this (bound to be closed as a dupe though, ha!)

Ok my bug was closed as a duplicate of 33332712, which is expected and totally fine.


But I can see that 33332712 is also closed, but no idea what the resolution is. Was it closed because it has been fixed (and will be in the next beta)? Or closed because it's not going to be fixed and we need to work around it? If anyone knows please share here, thanks!

Just installed beta 5. Bug was fixed for me 🙂

iOS 11 Beta 5 was fixed 🙂

Same here, all working ok now in beta 5! 🙂

App crashes on iOS 11 Beta 4 because of SymptomAnalytics private framework Event object
 
 
Q