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

  1. 4 years ago

    Jason K

    23 Jul 2015 Pre-Release Testers

    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

    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

  2. Dave S

    23 Jul 2015 San Diego, California USA
    Edited 4 years ago

    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>
  3. Jason K

    23 Jul 2015 Pre-Release Testers

    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:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    	<key>UIRequiredDeviceCapabilities</key>
    	<dict>
    		<key>gamekit</key>
    		<string>1</string>
    	</dict>
    </dict>
    </plist>

    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

  4. Dave S

    23 Jul 2015 San Diego, California USA

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

  5. Jason K

    23 Jul 2015 Pre-Release Testers

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

    Do you know what the plist entry should look like?

  6. Dave S

    23 Jul 2015 San Diego, California USA

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

  7. Jason K

    23 Jul 2015 Pre-Release Testers

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

  8. Jason K

    23 Jul 2015 Pre-Release Testers

    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.

  9. Jason K

    23 Jul 2015 Pre-Release Testers

    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...

  10. Dave S

    23 Jul 2015 San Diego, California USA

    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.

  11. Jason K

    23 Jul 2015 Pre-Release Testers

    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?

  12. Dave S

    23 Jul 2015 San Diego, California USA

    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

    //
    // GameKit.h
    // Game Center
    //
    // Copyright 2010-2015 Apple Inc. All rights reserved.
    //

    #import <GameKit/GKDefines.h>
    #import <GameKit/GKAchievement.h>
    #import <GameKit/GKAchievementDescription.h>
    #import <GameKit/GKAchievementViewController.h>
    #import <GameKit/GKChallenge.h>
    #import <GameKit/GKChallengeEventHandler.h>
    #import <GameKit/GKError.h>
    #import <GameKit/GKEventListener.h>
    #import <GameKit/GKFriendRequestComposeViewController.h>
    #import <GameKit/GKGameCenterViewController.h>
    #import <GameKit/GKLeaderboard.h>
    #import <GameKit/GKLeaderboardSet.h>
    #import <GameKit/GKLeaderboardViewController.h>
    #import <GameKit/GKLocalPlayer.h>
    #import <GameKit/GKMatch.h>
    #import <GameKit/GKMatchmaker.h>
    #import <GameKit/GKMatchmakerViewController.h>
    #import <GameKit/GKNotificationBanner.h>
    #import <GameKit/GKPeerPickerController.h>
    #import <GameKit/GKPlayer.h>
    #import <GameKit/GKPublicConstants.h>
    #import <GameKit/GKPublicProtocols.h>
    #import <GameKit/GKSavedGame.h>
    #import <GameKit/GKSavedGameListener.h>
    #import <GameKit/GKScore.h>
    #import <GameKit/GKSession.h>
    #import <GameKit/GKSessionError.h>
    #import <GameKit/GKTurnBasedMatch.h>
    #import <GameKit/GKTurnBasedMatchmakerViewController.h>
    #import <GameKit/GKVoiceChat.h>
    #import <GameKit/GKVoiceChatService.h>

  13. Jason K

    23 Jul 2015 Pre-Release Testers Answer

    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

or Sign Up to reply!