GameKit error "Application is not allowed to run in production"

I’m currently working on implementing all of GameKit for iOS and have come across a problem that I can’t seem to figure out. My test app works fine in the simulator and properly authenticates the local player, however in a deployed app to my phone I get the following error whenever I try to authenticate the user:

Jul 23 18:12:00 Jasons-iPhone gamed[135] <Warning>: Application(com.jasonking.gamekittest) is not allowed to run in production

Does anyone have any experience as to why this is happening or if anything special needs to be done when deploying to a phone? I’ve spent almost 2 hours with google and have only been able to find one reference to the problem hidden in the middle of a thread on the Unity forums which was mysteriously resolved and suddenly started working for them. If anyone has any idea of how to solve this, any help would be appreciated.

Thanks,
Jason

Do you have to do something special to enable “Game Center” entitlements?
For ObjC/Swift/Xcode there is a switch that says

Turning on Game Center

  • Adds the “Game Center” entitlement to you App ID
  • links the GameKit.Framework
  • add the “GameKit” key to your info plist

maybe that gives you a clue???

and it seems to add this to the plist

<key>UIRequiredDeviceCapabilities</key>
	<array>
		<string>armv7</string>
		<string>gamekit</string>
	</array>

Yes I think you are right and that is why I was asking. I created a new provisioning profile and enabled Game Center in it. I think I added the gamekit key to my info plist - I created a small plist which I dragged into the project:

[code]<?xml version="1.0" encoding="UTF-8"?>

UIRequiredDeviceCapabilities gamekit 1 [/code] I believe that Xojo should merge this into the plist it generates from what others have said on the forum, but maybe I have the plist wrong?

I believe that the compiler will auto link to the GameKit framework since I have several declares into it and it not linking was fixed in 2015r1.

Thanks for your help,
Jason

So that fixed it? :slight_smile:
I was just shooting in the dark

Unfortunately no, I tried that and it didn’t seem to make a difference :frowning:

Do you know what the plist entry should look like?

what I posted above is what XCODE creates when you activate the Game Center option… its not the same as what you posted

Oh I didn’t see your edit before. I’ll try that when I get back to my computer later. Thanks.

So unfortunately that didn’t work, I still get the error when deploying to a device, and the change makes the simulator not work… I’ll have to keep trying.

So I just created a new app with a provisioning profile that didn’t include Game Center and I get the exact same behavior - it works in the simulator and not in a deployed app. I wonder if the provisioning profile is respected by Xojo or if a generic one if used? Off to investigate some more…

The key may be in the first two bullets above… I don’t know what else XCODE does to a project when you select that option. The plist change was the only visible thing I saw… but it may embed items in the project file that link other framework(s) too.

So I just created a new project in Xcode and linked it with GameKit and I agree that the only visible change is the linking to the GameKit framework and the addition of the gamekit key to the plist file. I think I need to figure out how to specify entitlements in Xojo. There is a place to select an entitlements file in build settings but I’m not sure what format that would be and what it would need to contain to make everything work. Is there a resource that describes this?

In an Xcode project it links in a ton of GKxxx.h (ie. ObjC headers), 32 of them to be exact

all of these appear in the XCODEPROJECT file… which for some reason I cannot open with a texteditor anymore…hmmmm

Note : while these are ObjC headers, the project I got this out of was a SWIFT project, and these were linked just by selecting the GameKit capabiltiy option for the project

Ok, I just managed to get this to work. The problem is that Game Center sandboxing must be enabled in Settings or you aren’t allowed to test Game Center on a device. Thanks for all of the help you tried to provide, I really appreciate it.

Jason