I have implemented the apple’s unity plugins so i can use player’s game center informations to log in them. I followed the instructions on GitHub - apple/unityplugins and using Apple.Core and Apple.GameKit in my game. On my start scene i am calling the authentication method like “var player = await GKLocalPlayer.Authenticate();” and it is crashing the app immediately. i have tested through testflight and also ran the application through xcode, it is the same. The error i got from xcode is going like this
__Referenced from: <135CE991-5878-3356-855B-0EE3A58465F7> /private/var/containers/Bundle/Application/43C0628B-8BE1-4C04-9273-F9A5D1F2750E/**GameName.**app/Frameworks/UnityFramework.framework/UnityFramework__
__Reason: tried: '/usr/lib/swift/AppleCoreNative.framework/AppleCoreNative' (no such file, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/AppleCoreNative.framework/AppleCoreNative' (no such file), '/usr/lib/swift/AppleCoreNative.framework/AppleCoreNative' (no such file, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/AppleCoreNative.framework/AppleCoreNative' (no such file), '/private/var/containers/Bundle/Application/43C0628B-8BE1-4C04-9273-F9A5D1F2750E/The **GameName.**app/Frameworks/AppleCoreNative.framework/AppleCoreNative' (no such file), '/usr/lib/swift/AppleCoreNative.framework/AppleCoreNative' (no such file, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/AppleCoreNative.framework/AppleCoreNative' (no such file), '/usr/lib/swift/AppleCoreNative.framework/AppleCoreNative' (no such file, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/AppleCoreNative.framework/AppleCoreNative' (no such file), '/private/var/containers/Bundle/Application/43C0628B-8BE1-4C04-9273-F9A5D1F2750E/**GameName**.app/Frameworks/AppleCoreNative.framework/AppleCoreNative' (no such file), '/private/var/containers/Bundle/Application/43C0628B-8BE1-4C04-9273-F9A5D1F2750E/**GameName**.app/Frameworks/AppleCoreNative.framework/AppleCoreNative' (no such file), '/System/Library/Frameworks/AppleCoreNative.framework/AppleCoreNative' (no such file, not in dyld cache)__```
Has anyone experienced an error like this? I couldn't find any related example on the internet specific to these plugins so i am really open to any ideas right now.
I had the same issue. I was able to get past that error but then got the same error just with the GameKitWrapper Framework instead. I tried manually adding Frameworks, it did not work. Gave up and used the Sign In With Apple Unity plugin instead. Super annoying and wasted time. I hope they fix this or someone knows a solution.
Exactly same issue. It doesn’t seem to be related to MousePods link but it sucks to hear that the plugin will not work even if we manage to fix the library linking problem.
Update: Using this PR branch as base, then merging fixes from here and compiling it with included build script using 2020.3.33f1 Unity fixed above errors. Runtime testing is still ahead of me but at least it compiles and doesn’t crash at the first sight of GK methods during runtime.
Note: Please review and compare branches with original apple-unityplugins. It worked and it didn’t contain anything other than fixes at the time of posting but any of the branches may get updated in the future so be safe and verify what you’re merging.
Then the only extra thing I did was to change GKIdentityVerificationResponse.cs constructor at line 30 from internal to public. Ensure that you have Unity 2020.3.33f1 on your mac and compile with python3 build.py.
Idk if it solves all issues but it did work for us and we got GameCenter login working and the solution is usable on Windows machines, too.
Credit to dodgy-ltd and muZZkat who made the actual fixes and to MousePods who linked it here.
Redacted company/bundle ids but I tried to include all relevant parts from our CI pipeline. I hope it helps at least a bit but tbh we were changing so many things in the build settings in the meantime that I’m not even sure what part did the trick.
@kogi_rc Your are one of the greatest developers, thanks for the details instructions. After several months of failed attempts, finally it works. Again, thank you!
Hi, thank you for the detailed response. I’m experiencing a similar issue where the app crashes on startup with GameKitWrapper. I fetched and merged the branch muzzkat/muzzkat/fix-fetch-items, built python3 build.py with Unity 2020.3.33f1, and also updated the GKIdentityVerificationResponse.cs but I’m still getting this error. I’m a newbie to iOS development and xcode, hope someone can help.
@camillazi I wondered that the Unity editor version of your Unity project might be different from 2020.3.33f1.
If that is the case, you should either switch the editor version of your unity project to 2020.3.33f1 via Unity Hub, or switch the editor version of the Unity projects of the apple-unity plugins.
If you go with the latter one, then you need a few extra steps in the plugin build steps.
apply the patches from the awesome contributors to your local repo of apple/apple-unityplugins as @kogi_rc described above.
switch Unity editor version of the Unity project of each plugin source. For example, in the case of Apple.Core:
add the existing Unity project at plug-ins/Apple.Core/Apple.Core_Unity on Unity Hub
switch Unity editor version of Apple.Core_Unity project to the same version as your Unity project use
after the editor version switch complete and a Unity editor open, just close the editor
after repeating the steps above for the plugins you need, run python3 ./build.py
just in case, check the build outputs to see whether the plugins are built with the same Unity version as your Unity project
add the plugins from the built tarball files to your Unity project via the package manager
With my project using Apple.Core and Apple.Apple.GameKit, I confirmed it made the plugin work with Unity editor 2021.3.31f1 and 2022.3.11f1. My Xcode version is 15.0.1 in both case.
@kogi_rc and @ycode thank you so much for your help with this. I never could’ve figured out how to get past this on my own lol.
@ycode@camillazi - I got it working in 2022.3.11.f1 with your steps above, but I also had to go into Edit > project settings > Apple Build Settings and change the minimum ios version to 14.0.
I haven’t actually built with any of my code that uses the plugins atm, but these threads at least got my app up and running with the packages in it. I really hope Apple gets the issue fixed officially soon.
I’ve got a build working that can authenticate using the GKLocalPlayer.Authenticate(), so the changes made in my comment above definitely work. I also am able to use GKAccessPoint functions without issue.
But I can’t get all of the Game Kit features to work.
For instance, if I try to use the GKGameCenterViewController as shown in the plugin’s documentation:
var gameCenter = GKGameCenterViewController.Init(GKGameCenterViewController.GKGameCenterViewControllerState.Achievement);
it throws a C# exception about there not being a default constructor for the class.
More importantly though, I can’t seem to get GKAchievement.LoadAchievements() or GKAchievementDescription.LoadAchievementDescriptions() to work. Both of these functions cause the app to throw an exception at the xcode level (sorry if this is the incorrect way to describe it; I’m new to ios/xcode dev):
libc++abi: terminating due to uncaught exception of type Il2CppExceptionWrapper xcode
I have achievements configured in the dev portal for the app, and I am able to see them if I click on the GKAccessPoint and go to the app’s achievement list in the Game Center window.
I did delete a couple of them from the portal after testing and the removals weren’t reflected in the access point’s achievement list, so I’m not sure if the error I’m seeing is something wrong with the plugin, or if it’s something wrong with my app setup/connection.
I was experiencing the same error when trying to load achievements and post achievement progress to GameKit. I created a link.xml file in the /Assets/ folder which fixed my issue.