Search Unity

Bug Services Core exception

Discussion in 'Unity Gaming Services General Discussion' started by smithmj5, Nov 3, 2022.

  1. smithmj5

    smithmj5

    Joined:
    May 24, 2013
    Posts:
    143
    I wasn't sure where to post this, I couldn't find a specific forum for Services Core.

    I'm using Unity In App Purchasing v4.5.1 and Services Core 1.5.2 in Unity 2020.3.40f1.

    I'm getting an exception in Unity Crash Reporting dashboard. These are only happening on Android (they do not occur on iOS).

    This exception is new since I updated the IAP and Services Core plugins.

    Happy to share a link to my project/dashboard, just let me know.

    Thanks!

    Code (CSharp):
    1. [ServicesCore]: System.InvalidOperationException: Collection was modified; enumeration operation may not execute. at System.ThrowHelper.ThrowInvalidOperationException (System.ExceptionResource resource) [0x00000] in <00000000000000000000000000000000>:0 at System.Collections.Generic.List`1+Enumerator[T].MoveNextRare () [0x00000] in <00000000000000000000000000000000>:0 at System.Collections.Generic.List`1+Enumerator[T].MoveNext () [0x00000] in <00000000000000000000000000000000>:0 at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList (Newtonsoft.Json.JsonWriter writer, System.Collections.IEnumerable values, Newtonsoft.Json.Serialization.JsonArrayContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract collectionContract, Newtonsoft.Json.Serialization.JsonProperty containerProperty) [0x00000] in <00000000000000000000000000000000>:0 at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject (Newt
    2. Unity.Services.Core.Scheduler.Internal.ActionScheduler:ExecuteExpiredActions()
    3.  
    4. Managed Stack Trace:
    5.  
    6. Unity.Services.Core.Scheduler.Internal.ActionScheduler:ExecuteExpiredActions()
    7. UnityEngine.LowLevel.UpdateFunction:Invoke()
     
  2. John_Corbett

    John_Corbett

    Joined:
    May 17, 2019
    Posts:
    151
    Hi @smithmj5,

    This is the first time we've seen this particular exception related to IAP. We're making a bugfix to be shipped as part of IAP 4.5.2 (date TBD) that has avoided thread-related collection modification clashes. We're trying to include other bugfixes, so it's going to be a while before it's released, but hopefully soon (a matter of weeks).

    I can't be sure it's 100% related to this exception, but I can try to follow up here again when it's released.

    How easy is it to reproduce this bug? What's its prevalence/frequency?
     
  3. smithmj5

    smithmj5

    Joined:
    May 24, 2013
    Posts:
    143
    I'll send you the URL for the exceptions noted above that I'm seeing. I can't repro them myself (seldom can I repro these types of exceptions on Android, they're so specific).

    I'm aware of the other issues with IAP 4.5.1, I posted about them here earlier today: https://forum.unity.com/threads/three-new-exceptions-in-unity-iap-and-services-core.1356830/ - I'm getting those exceptions too. :)