Skip to content

Crash occurring when authenticating user for Game Center #60

Closed

Description

@FunkyFingerJames

Describe the bug
I am using the latest version of the Game Center plugin for Unity and have noticed that my game will crash on launch when trying to authenticate.

I've tried this in an empty project with just the plugin and it still crashes with this exception.
GfxDevice: creating device client; threaded=1; jobified=0 Initializing Metal device caps: Apple A14 GPU Initialize engine version: 2022.3.62f2 (7670c08855a9) GameKitException: Code=-7 Domain=GKErrorDomain Description=The operation couldn’t be completed. (GKErrorDomain error -7.) (UnsupportedOperationForOSVersion) at Apple.GameKit.DefaultNSErrorHandler.ThrowNSError (System.IntPtr nsErrorPtr) [0x00000] in <00000000000000000000000000000000>:0 Rethrow as TypeInitializationException: The type initializer for 'Apple.GameKit.GKGameActivity' threw an exception.

And the area in the native code that is triggering the crash is this inside the GKLocalPlayer_SetAuthenticateHandler function
_onAuthenticate!(tid, _mostRecentAuthenticatePlayer!.passRetainedUnsafeMutablePointer());

I have also included this message because I thought it might help too

terminating due to uncaught exception of type Il2CppExceptionWrapper Could not import Swift modules for translation unit: failed to get module "GameKitWrapper" from AST context: error: 'GKErrorCodeExtension.h' file not found in file included from <module-includes>:1: error: could not build Objective-C module 'GameKitWrapper' warning: Ignoring missing VFS file: /Users/james/Library/Developer/Xcode/DerivedData/GameKitWrapper-dzawbtxqdxdviiakfxmfunexppqv/Build/Intermediates.noindex/GameKitWrapper.build/Release-iphoneos/GameKitWrapper-bc72bd3638f4d2956cac9b00e84c1a7d-VFS-iphoneos/all-product-headers.yaml This is the likely root cause for any subsequent compiler errors.warning: Ignoring missing VFS file: /Users/bill/Library/Developer/Xcode/DerivedData/GameKitWrapper-dzawbtxqdxdviiakfxmfunexppqv/Build/Intermediates.noindex/GameKitWrapper.build/Release-iphoneos/GameKitWrapper iOS.build/unextended-module-overlay.yaml This is the likely root cause for any subsequent compiler errors.warning: TypeSystemSwiftTypeRef::GetNumChildren: had to engage SwiftASTContext fallback for type $syyXCD

To Reproduce
Create XCode build and run on iOS device.
The error occurs when the GKLocalPlayer.Authenticate() function is called.
I have also included the script that we use for triggering the function (see attached GameCenterManager script).

We can update our Mac Mini to macOS 26 if need be but we would like to know ahead of time how likely it is that this would fix this issue as the min specs for this plugin state that it should support macOS 11.5 and iOS 15.6. We are not actually using GKGameActivity as you can see in the attached GameCenterManager script. We are only trying to add achievement support.

  • Device: Mac Mini M2 2023, iPhone 12 mini
  • OS: MacOS 15.7.2, iOS 18.6.2
  • Version: Unity 2022.3.62f2
  • Plugin Components: Core, GameKit

GameCenterManager.txt

Activity

  1. sebastienmalicet commented on Nov 17, 2025

    @sebastienmalicet

    Hello,
    "Apple.GameKit.GKGameActivity" feature required macOS 26.

  2. FunkyFingerJames commented on Nov 17, 2025

    @FunkyFingerJames
    Author

    Ok, so if we update to macOS 26 then it should fix this issue on the iOS build? Why does the main repo page mention the minimum supported version of macOS is 11.5 if using GameKit will require updating to macOS 26? is it just out of date because of the recent commit that added support for 26?

    We aren't actually using Game Activity, our code right now is only trying to authenticate at the moment.

  3. KevinBjorv commented on Nov 18, 2025

    @KevinBjorv

    I'm getting this as well for all my testers that are not using IOS 26.

  4. MattWallaceAzra commented on Nov 18, 2025

    @MattWallaceAzra

    Same here- ios 18 throws this exception, I assume docs need to be updated to reflect ios 26 requirement.

  5. ryzngard commented on Nov 18, 2025

    @ryzngard
    Collaborator

    Thanks for filing. Does this happen on the 3.0.2 release?

  6. FunkyFingerJames commented on Nov 19, 2025

    @FunkyFingerJames
    Author

    This was happening with the GameKit 4.0.1 plugin and Core 3.2.0. It doesn't seem to happen on GameKit 3.0.0 but I haven't tried 3.0.2.
    I did just discover today though that if you set the Managed Stripping Level in the Player settings to Minimal then it at least stops things from crashing (and I was able to get the authentication to work and log the user in).

  7. MattWallaceAzra commented on Nov 19, 2025

    @MattWallaceAzra

    I downgraded our project to the 3.0.2 release and this no longer occurs.

  8. boena commented on Nov 20, 2025

    @boena

    I'm having the same issues here running Unity 6000.2.13f1 and Xcode 26.1.1. I've tried downgrading to 3.0.2 release but still face the same issues. Trying it on my iPhone with iOS 26.0.1 :(

  9. boena commented on Nov 20, 2025

    @boena

    I can also confirm what @FunkyFingerJames said that setting Managed Stripping Level to Minimal actually fixes the crash and my user is correctly signed in on both 3.0.2 and 4.0.1...

  10. KevinBjorv commented on Nov 22, 2025

    @KevinBjorv

    I can also confirm what @FunkyFingerJames said that setting Managed Stripping Level to Minimal actually fixes the crash and my user is correctly signed in on both 3.0.2 and 4.0.1...

    Doesn't work for me unfortunently. I had to disable gamekit for all users not on IOS 26. That's the only solution I could find.

  11. JVimes commented on Dec 6, 2025

    @JVimes

    I get the UnsupportedOperationForOSVersion on the latest commit but not on the GameKit-3.0.2 commit. I built the plugins for iOS and see the exception running in Unity on Mac 15.7.2 (the latest for my machine).

  12. ryzngard commented on Dec 9, 2025

    @ryzngard
    Collaborator

    Any code stripping issues should be solved with #73

    I'm looking into the GKGameActivity regression. That is identified correctly as a 26+ API but shouldn't be instantiated on older OS.

  13. self-assigned this
    on Dec 9, 2025
  14. added a commit that references this issue on Dec 9, 2025
    7572e35
  15. ryzngard commented on Dec 9, 2025

    @ryzngard
    Collaborator

    Please try the changes in #74 and let me know if you are unblocked. Testing with the demo app on iOS 18 worked for me.

  16. JVimes commented on Dec 10, 2025

    @JVimes

    @ryzngard The branch from #74 works on my machine but builds GameKit 3.0.2 (not 4.0.1). Is that right?

  17. ryzngard commented on Dec 10, 2025

    @ryzngard
    Collaborator

    @JVimes that is unexpected. The package.json is showing 4.0.1.

  18. JVimes commented on Dec 10, 2025

    @JVimes

    @ryzngard My bad. 4.0.1 works on my machine.

  19. added a commit that references this issue on Dec 11, 2025
    9f82e7f
  20. added a commit that references this issue on Sep 16, 2026
    a361954
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions