Search Unity

Native crash - InvokeGameCenterCallback

Discussion in 'iOS and tvOS' started by Grazer2, Nov 20, 2017.

  1. Grazer2

    Grazer2

    Joined:
    Jun 20, 2011
    Posts:
    86
    Hello,

    One of the apps I'm working on shows the following exception occasionally in the cloud build reporting window:

    Native Crash - il2cpp::vm::Runtime::RaiseExecutionEngineExceptionIfMethodIsNotFound(MethodInfo const*) (Unknown File)

    Thread 0 (crashed)
    0 projectname il2cpp::vm::Runtime::RaiseExecutionEngineExceptionIfMethodIsNotFound(MethodInfo const*)
    1 projectname Action_1_Invoke_m2188644904_gshared
    2 projectname Action_1_Invoke_m2188644904_gshared
    3 projectname RuntimeInvoker_Void_t2684433624_RuntimeObject_RuntimeObject(void (*)(), MethodInfo const*, void*, void**)
    4 projectname il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**)
    5 projectname scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool)
    6 projectname ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool)
    7 projectname InvokeGameCenterCallback(char const*, ScriptingArguments const&)
    8 projectname void GameCenter::TriggerCallback<ScriptingObjectPtr, ScriptingArrayPtr>(char const*, ScriptingObjectPtr const&, ScriptingArrayPtr const&)
    9 projectname __39+[AchievementWrapper loadAchievements:]_block_invoke
    10 GameCenterFoundation __39-[GKDispatchGroup notifyOnQueue:block:]_block_invoke.63
    11 libdispatch.dylib _dispatch_call_block_and_release
    12 libdispatch.dylib _dispatch_client_callout
    13 libdispatch.dylib _dispatch_main_queue_callback_4CF$VARIANT$mp
    14 CoreFoundation __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
    15 CoreFoundation __CFRunLoopRun
    16 CoreFoundation CFRunLoopRunSpecific
    17 GraphicsServices GSEventRunModal
    18 UIKit UIApplicationMain
    19 projectname main
    20 libdyld.dylib start


    Any idea what's causing this and how to fix it?

    Unity Version: 2017.2.0f3
    Affected devices: iOS 11.0, iOS 11.0.3 (maybe more than those)
     
    Mortennobel likes this.
  2. Grazer2

    Grazer2

    Joined:
    Jun 20, 2011
    Posts:
    86
    Bumping out of despair
     
  3. Pixelome

    Pixelome

    Joined:
    Sep 30, 2014
    Posts:
    11
    I'm having the same issue on iOS 10.3 and 11.0. Might be a threading issue since in the crash report I have 40 threads most of which are waiting on a semaphore.

    Code (CSharp):
    1. CappedSemaphore::WaitForSignal()
    2. JobQueue::ProcessJobs(void*)
    3. JobQueue::WorkLoop(void*)
    4. Thread::RunThreadWrapper(void*)
     
  4. kobyle

    kobyle

    Joined:
    Feb 23, 2015
    Posts:
    92
    Same here, did you solve it?
     
  5. AG_VR

    AG_VR

    Joined:
    Dec 19, 2017
    Posts:
    5
    Hi, I got exactly the same issue with an application published this Friday using Unity 5.6.5p3...
    The bug randomly occurs on random devices using iOS 11.1 - 11.2 - 11.3. (20% of devices are impacted...)
    It seems that iOS callback send a callback information in some cases Unity is totally unable to treat...
    Does someone got any workaround or kick fix for it?
    Thanks
     
    Last edited: Apr 16, 2018
  6. MorenoBralts

    MorenoBralts

    Joined:
    May 23, 2017
    Posts:
    19
    Still happening in Unity 2017.4.1
     
  7. Mortennobel

    Mortennobel

    Joined:
    Mar 20, 2009
    Posts:
    2
    Still happening in Unity 2017.4.5
     
  8. AG_VR

    AG_VR

    Joined:
    Dec 19, 2017
    Posts:
    5
    Are Unity devs working on it or is it just lost into the void?
     
  9. reach_Seema

    reach_Seema

    Joined:
    Jan 16, 2016
    Posts:
    6
    Any update on this issue. I am facing the same issue.
     
  10. Time-Jockey

    Time-Jockey

    Joined:
    Oct 11, 2012
    Posts:
    14
    I’m facing a very similar crash when calling LoadAchievements
     
  11. Grazer2

    Grazer2

    Joined:
    Jun 20, 2011
    Posts:
    86
    Bumping to find out if anybody knows whether or not this got resolved by now
     
  12. bhallion

    bhallion

    Joined:
    Mar 26, 2018
    Posts:
    5
    Hello there,

    I'm currently facing the same issue. I also have a message in my console:

    "Failed to load achievements The requested operation could not be completed due to an error communicating with the server."

    In my case, I fixed the problem by adding a delay of 2 seconds (arbitrary) between Social.localUser.Authenticate callback and SocialPlatform.LoadAchievements
     
  13. tamerobots

    tamerobots

    Joined:
    May 19, 2016
    Posts:
    1
    I used bhallion's 2 second fix and it seems to work fine for me. Thanks bhallion
     
  14. benbenmushi

    benbenmushi

    Joined:
    Jan 29, 2013
    Posts:
    34
    Hello !

    Here is our approch:

    Code (CSharp):
    1.  
    2. // Achievements can only be fetched once player is authenticated
    3. var wait = new WaitForSeconds(0.1f);
    4. while (socialPlatform.localUser == null ||
    5.        socialPlatform.localUser.authenticated)
    6.    yield return wait;
    7.  
    8. // Start loading process
    9. socialPlatform.LoadAchievements((IAchievement[] inProgress) =>
    10. {
    11.    socialPlatform.LoadAchievementDescriptions((IAchievementDescription[] descriptions) =>
    12.    {
    13.       OnAchievementsFetched(inProgress, descriptions);
    14.    });
    15. });
     
  15. xman800

    xman800

    Joined:
    Feb 27, 2017
    Posts:
    25
  16. habitoti

    habitoti

    Joined:
    Feb 28, 2013
    Posts:
    141
    No matter if lambda or function, 1 or 2 second delay, separate from authentication callback, waiting for scene to finish loading or trying to wrap in a try-catch: the crash will occur anyhow on a number of devices out in the wild, and almost never when you try to reproduce locally. And because the standard Social implementation of the achievement reporting doesn‘t remember what it reported already and will keep notifying users of recurring achievement gains, you have to load them and keep track of them on your own. Such a shame that this wasn‘t addressed for 2019.xx. Was fixed for 2018.4 and 2020.2, but 2019 seems to be abandoned...
     
    Last edited: Jun 2, 2020
    mahdie likes this.
  17. mahdie

    mahdie

    Joined:
    May 21, 2017
    Posts:
    7
    I may also add that I had the crash even though I'm not loading any achievements. I'm just logging in users to GameCenter! But, I must say that the process could be happening during a loading of the next scene. So, I think we're not far ahead with this since it started!