Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Bug GKLocalPlayer.Local.FetchItems() Error on Unity

Discussion in 'Authentication' started by MousePods, Feb 4, 2023.

  1. MousePods

    MousePods

    Joined:
    Jul 19, 2012
    Posts:
    682
    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.

    Code (CSharp):
    1. var fetchItemsResponse = await GKLocalPlayer.Local.FetchItems();
    Code (CSharp):
    1. Thread 1: EXC_BAD_ACCESS (code=257, address=0x2)
    Is there a fix coming soon?

    Thanks
     
  2. clementescoffier

    clementescoffier

    Joined:
    Sep 21, 2020
    Posts:
    6
    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
     
    AndreaMar likes this.
  3. clementescoffier

    clementescoffier

    Joined:
    Sep 21, 2020
    Posts:
    6
    nvm, I have the error on another device i tested
     
  4. ted05051997

    ted05051997

    Joined:
    May 7, 2020
    Posts:
    4
    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
     
  5. SebT_Unity

    SebT_Unity

    Unity Technologies

    Joined:
    Jun 21, 2021
    Posts:
    215
    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.
     
  6. TomTheMan59

    TomTheMan59

    Joined:
    Mar 8, 2021
    Posts:
    191
    SebT_Unity likes this.
  7. unity_DD36632923EDB25EB366

    unity_DD36632923EDB25EB366

    Joined:
    Feb 7, 2023
    Posts:
    2
    He said he fixed the pointer thing in that branch but the callback still not working actually
     
  8. unity_DD36632923EDB25EB366

    unity_DD36632923EDB25EB366

    Joined:
    Feb 7, 2023
    Posts:
    2
    Stuck in this problem for 2 weeks already, thanks for finally someone related try to handle it
     
    SebT_Unity likes this.
  9. TomTheMan59

    TomTheMan59

    Joined:
    Mar 8, 2021
    Posts:
    191
    It works for me
     
    SebT_Unity likes this.
  10. TheEugeneL

    TheEugeneL

    Joined:
    Dec 7, 2017
    Posts:
    34
    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 https://gist.github.com/BastianBlokland/bbc02a407b05beaf3f55ead3dd10f808

    So I got:
    publicKeyUrl, signature, salt and timestamp

    And it works perfectly. Authorization on the Unity side works without any problems.
     
    SebT_Unity likes this.
  11. ted05051997

    ted05051997

    Joined:
    May 7, 2020
    Posts:
    4
    Is there any update on this issue?
     
  12. SebT_Unity

    SebT_Unity

    Unity Technologies

    Joined:
    Jun 21, 2021
    Posts:
    215
    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
     
  13. AndreaMar

    AndreaMar

    Joined:
    Oct 29, 2019
    Posts:
    31
    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". :mad:
     
    Last edited: Mar 16, 2023 at 8:37 AM