GKLocalPlayer.Local.FetchItems() Error on Unity

I setup everything correctly for adding Apple GameCenter so I can use Cloud Save. On device, I successfully login and it shows the banner.

I get this error when the next line of code is called.

var fetchItemsResponse = await GKLocalPlayer.Local.FetchItems();
Thread 1: EXC_BAD_ACCESS (code=257, address=0x2)

Is there a fix coming soon?

Thanks

I’m having the same problem as you, except no Thread 1: EXC_BAD_ACCESS (code=257, address=0x2) error, it just crashes and cuts connection from the device to XCode

1 Like

nvm, I have the error on another device i tested

I have the same problem,
fetchItems()
OnSuccess()
Thread 1: EXC_BAD_ACCESS (code=257, address=0x2) error, it just crashes when cuts connection from the device to XCode
if not cut connection, it will keep stay in this error line in Xcode
using Unity 2021.3.9f, build on iOS,
manually modified manifest.json to use unity authentication 2.4.0
using Apple Game Center plugin for unity

Hi everyone,
There is currently an issue with Apple Game Center that we are aware of. We are in contact with Apple to get that resolved.

I will postback here once we have more information.

5 Likes

For anyone looking for a solution look at the bottom of this post. Someone posted a git where they fixed it.

https://developer.apple.com/forums/thread/722593

2 Likes

He said he fixed the pointer thing in that branch but the callback still not working actually

Stuck in this problem for 2 weeks already, thanks for finally someone related try to handle it

1 Like

It works for me

1 Like

I also have the same error and so I could not use the apple plugin.

I found another path.
First I used Social.localUser.Authenticate();
Social.localUser.id - is TeamPlayerID;

then I used code from this link Way to get the game-center verification signature with Unity. · GitHub

So I got:
publicKeyUrl, signature, salt and timestamp

And it works perfectly. Authorization on the Unity side works without any problems.

2 Likes

Is there any update on this issue?

Hi,
I’ve asked the development team to take a look at the suggested workaround proposed above.
We also have an open ticket with Apple.

I will postback here when I have more news

3 Likes

People here are saying that this git branch is working properly. I still have to give it a try as soon as I can.

I confirm. It’s working. It’s impossible to select target platforms while building tars though.

I’m nonetheless waiting for the official release.

EDIT: I’m having troubles when I switch back to Android. Unity is building the Apple plugins for Android as well and this creates problems. It seems I cannot deselect the Android platform from the plugin inspector: even if I select only iOS and apply changes, as I try to build the .apk selection are resetting to “Any platform”. :rage:

Tried the fix but it currently has the GetSalt and Get Signature functions disabled which i need to Authorize cloud saving.

1 Like

Use this. GetSalt() and GetSignature() functions are not available with this mod. Use .Salt and .Signature properties instead. They work fine in my project.

An annoying problem though is that every time I switch to Android for building my game these plugins (I’m using Core and GameKit) are included in the build process which I cannot complete because of a few errors. I can’t edit the selected devices in the plugin inspector. I always have to remove the packages and re-import them again.

I also cannot target iOS versions lower than 14.0. If I do, the app will crash on launch because of a GameKitWrapper-something missing. But I haven’t checked yet if this is a requirement for the mod only or for the official Apple release as well.

I hope they’ll fix this soon.

1 Like

Weird, I tried using the .Salt and .Signature properties and it kept telling me there was no permision/access for it or something I forgot the specifics, even though everything was public. This caused me to switch back to whatever the latest was. I have had wayyyyy too many issues with Apple and XCode from these plugins.

I’m just going to hold out for a fix. I hope it is actually being worked on.

1 Like

Can you upload a screenshot?

I might be going crazy now. I reimported the fix again reverting from the latest version. Now .GetSignature() and .Signature both don’t exist. Think I will wait this out.

You have to switch branches to fix-fetch-items. https://github.com/muZZkat/unityplugins/tree/muzzkat/fix-fetch-items.
Run the python script to build the unity tar files. Then import.

Personally, I unpack the entire tar files and copy the uncompressed folder into my project entirely.

Yeah absolutely, that’s exactly what I did, which is funny becuase importing the tar file dirrectly causes it to have no read/write permissions to imported package files which was a whole nother headache I had to figure out.

But anyways, I had the latest version, reverted to the the fix branch, which was indeed working, since the GetSignature() was removed. Discovered the .Signature reference, which in the editor kept telling me there were no permisions for that reference like it was a private varriable. So I just reverted back to the latest branch.

As per the advice of the others, AndreaMar asked me to get the screen of that error. So I went through the whole proccess again. Now I do not have GetSignature() or .Signature. So I am certainly on the Fix branch especially after re-doing the plugins like 3 times now.

So thats where I am at.