Xcode 9: GKPlayerAuthenticationDidChangeNotificationName an Unresolved Identifier

Number:rdar://33489033 Date Originated:July 24, 2017
Status:Open Resolved:
Product:Developer Tools Product Version:9.0/9M174d
Classification:Bug Reproducible:Always
When building an app that uses GameKit in Xcode 9 the GKPlayerAuthenticationDidChangeNotificationName notification name is an unresolved identifier error. Jumping to definition shows the definition of this identifier, and building the same project in Xcode 8 succeeds, so the identifier is there, but Xcode 9 seems not to be finding it.

Steps to Reproduce:
Use a line like the following anywhere in a file that also imports GameKit:

NotificationCenter.default.addObserver(self, selector: nil, name: NSNotification.Name(rawValue: GKPlayerAuthenticationDidChangeNotificationName), object: nil)

Note: selector is nil for the purposes of the sample project being attached. In normal use that would refer to a function elsewhere in the file or project.

Expected Results:
GKPlayerAuthenticationDidChangeNotificationName to be found.

Observed Results:
GKPlayerAuthenticationDidChangeNotificationName is an unresolved identifier error.

Xcode: 9.0/9M174d
macOS: 10.12.6/16G29

I have attached a simple project that illustrates this bug. All the project does is try to register for the GKPlayerAuthenticationDidChangeNotificationName in the AppDelegate at didFinishLaunchingWithOptions. Even without building the static analyzer reports the line as an error.


Xcode 9 gm

Still happening. Workaround?

I have confirmed that this is still an issue with the 4th beta of Xcode: 9.0/9M189t.

By alexceleste at July 27, 2017, 10 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!