Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Multiple exceptions after updating to the v4.4.1

Discussion in 'Unity IAP' started by tduriga, Sep 19, 2022.

  1. tduriga

    tduriga

    Joined:
    Dec 9, 2015
    Posts:
    52
    Hi,
    we updated Unity IAP package to remove "Google Play Billing" warning in Google Play Console and now we're seeing many exceptions in Cloud Diagnostics. All exceptions mention "Unity.Services.Core".

    Here are some of the stack traces:

    and the last stack trace report is only single line, but it was reported more than 12000 times by only 3 impacted users:
    Additional details:
    • Unity version 2021.3.9f1
    • IAP Package version 4.4.1
    • Services Core version 1.4.3
    • Remote Config version 3.1.3
    Is this a known issue or it might be result of some implementation error? Inapp purchases seem to be working fine when we test the games, but we can't replicate these exceptions on our devices.
     
  2. Yannick_D

    Yannick_D

    Unity Technologies

    Joined:
    Feb 21, 2022
    Posts:
    226
    Thank you for the reports, we will investigate this with the Services Core team.
    The first issue was known so this is most likely not an implementation error.
     
    tduriga likes this.
  3. Mese

    Mese

    Joined:
    Dec 13, 2015
    Posts:
    41
    We are seeing this behaviour too.
    • Unity version 2020.3.15f2
    • IAP Package version 4.4.1
    • Services Core version 1.4.0
    • Analytics 4.0.1

    Here's is a snippet of our packages-lock.json.

    Code (json):
    1.   "com.unity.purchasing": {
    2.       "version": "4.4.1",
    3.       "depth": 0,
    4.       "source": "registry",
    5.       "dependencies": {
    6.         "com.unity.ugui": "1.0.0",
    7.         "com.unity.modules.unityanalytics": "1.0.0",
    8.         "com.unity.modules.unitywebrequest": "1.0.0",
    9.         "com.unity.modules.jsonserialize": "1.0.0",
    10.         "com.unity.modules.androidjni": "1.0.0",
    11.         "com.unity.services.core": "1.3.1",
    12.         "com.unity.services.analytics": "4.0.1"
    13.       },
    14.       "url": "https://packages.unity.com"
    15.     },
    16.     "com.unity.services.analytics": {
    17.       "version": "4.0.1",
    18.       "depth": 1,
    19.       "source": "registry",
    20.       "dependencies": {
    21.         "com.unity.ugui": "1.0.0",
    22.         "com.unity.services.core": "1.4.0"
    23.       },
    24.       "url": "https://packages.unity.com"
    25.     },
    26.     "com.unity.services.core": {
    27.       "version": "1.4.0",
    28.       "depth": 2,
    29.       "source": "registry",
    30.       "dependencies": {
    31.         "com.unity.modules.unitywebrequest": "1.0.0",
    32.         "com.unity.nuget.newtonsoft-json": "3.0.2",
    33.         "com.unity.modules.androidjni": "1.0.0"
    34.       },
    35.       "url": "https://packages.unity.com"
    36.     }
    Another Error:

    Code (CSharp):
    1. Non-fatal Exception: java.lang.Exception: [ServicesCore] : System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
    2.   at System.ThrowHelper.ThrowInvalidOperationException (System.ExceptionResource resource) [0x00000] in <00000000000000000000000000000000>:0
    3.   at System.Collections.Generic.List`1+Enumerator[T].MoveNextRare () [0x00000] in <00000000000000000000000000000000>:0
    4.   at System.Collections.Generic.List`1+Enumerator[T].MoveNext () [0x00000] in <00000000000000000000000000000000>:0
    5.   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
    6.   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue (Newtonsoft.Json.JsonWriter writer, System.Object value, Newtonsoft.Json.Serialization.JsonContract valueContract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerProperty) [0x00000] in <00000000000000000000000000000000>:0
    7.   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject (Newtonsoft.Json.JsonWriter writer, System.Object value, Newtonsoft.Json.Serialization.JsonObjectContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract collectionContract, Newtonsoft.Json.Serialization.JsonProperty containerProperty) [0x00000] in <00000000000000000000000000000000>:0
    8.   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue (Newtonsoft.Json.JsonWriter writer, System.Object value, Newtonsoft.Json.Serialization.JsonContract valueContract, Newtonsoft.Json.Serialization.JsonProperty member, Ne<truncated: 2360 chars>
    9.        at UnityEngine.Logger:Log(UnityEngine)
    10.        at Unity.Services.Core.Internal.CoreLogger:LogException(Unity.Services.Core.Internal)
    11.        at Unity.Services.Core.Scheduler.Internal.ActionScheduler:ExecuteExpiredActions(Unity.Services.Core.Scheduler.Internal)
    12.        at UnityEngine.LowLevel.UpdateFunction:Invoke(UnityEngine.LowLevel)
    Please fix this!
     
    Last edited: Sep 23, 2022
  4. Mese

    Mese

    Joined:
    Dec 13, 2015
    Posts:
    41
    I'm now realizing this might not be the same issue.
    Please confirm, I'll open another thread
     
  5. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    We are working on this.
     
  6. Mese

    Mese

    Joined:
    Dec 13, 2015
    Posts:
    41
    Thanks!
     
  7. Sailendu

    Sailendu

    Joined:
    Jul 23, 2009
    Posts:
    254
    I am also facing similar exceptions in Unity Cloud Diagnostics.
    • Unity version 2020.3.39f1
    • IAP Package version 4.4.1
    • Services Core version 1.4.0
    • Analytics 4.0.1

    Also there are several log messages with:
     
    Last edited: Sep 25, 2022
    JeffDUnity3D likes this.
  8. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Thank you for confirming, the error would be expected on Cloud Build also until we address the issue. The PurchasingUnavailable would be a separate issue, anything in common in the diagnostics? Android/iOS?
     
  9. Mese

    Mese

    Joined:
    Dec 13, 2015
    Posts:
    41
    We are also seeing the exception that @Sailendu posted:

    But we are not using Cloud Build.
    We have only built on Android. No IOs yet.
     
  10. Mese

    Mese

    Joined:
    Dec 13, 2015
    Posts:
    41
    Another Trace that might be related:

     
  11. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Can you provide steps to reproduce? We believe we have identified the issue but could use reproduction steps.
     
  12. Mese

    Mese

    Joined:
    Dec 13, 2015
    Posts:
    41
    Very sorry, we couldn't repro it ourselves.
    We are just getting it from GooglePlay Console and Crashlytics :(

    If I find anything more, I'll update.

    Thanks
     
    Last edited: Sep 27, 2022
  13. Sailendu

    Sailendu

    Joined:
    Jul 23, 2009
    Posts:
    254
    I also can not reproduce it, the exceptions are appearing in Unity Cloud Diagnostics where the user crashes are viewed, I am also not using Cloud Build, it is on Android, have not uploaded the same build to iOS yet, so not sure about iOS.
     
  14. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Got it, thanks.
     
  15. ignapa12

    ignapa12

    Joined:
    Jan 31, 2020
    Posts:
    1
    We are also experiencing the same exception @Sailendu posted.
    Unfortunately we can't reproduce it.

    Any news on this issue?
     
  16. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    We are actively working on it, but no ETA yet
     
  17. vividream

    vividream

    Joined:
    Nov 1, 2016
    Posts:
    7
     

    Attached Files:

  18. vividream

    vividream

    Joined:
    Nov 1, 2016
    Posts:
    7
     

    Attached Files:

  19. vividream

    vividream

    Joined:
    Nov 1, 2016
    Posts:
    7
     

    Attached Files:

  20. vividream

    vividream

    Joined:
    Nov 1, 2016
    Posts:
    7
  21. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    As mentioned, we are working on this. Additional screenshots are not necessary, thanks! Unity IAP is not supported on XIaomi or Huawei devices
     
  22. Brown2Fox

    Brown2Fox

    Joined:
    Mar 6, 2017
    Posts:
    7
    Is Unity IAP not supported on ANY Xiaomi or Huawei devices? Or just on those of them which does not include google services?
     
  23. Mese

    Mese

    Joined:
    Dec 13, 2015
    Posts:
    41
    My personal device is a Xiaomi with GPS installed and it works just fine, we have a few of huawei / xiaomi on the office, it works on all that have GPS installed, and does not on the ones that doesnt.
    My estimated guess is that it works with GPS installed. But the officiall Unity stand is that it is not supported for that reason (or any other reason) to avoid troubles (which is fine).

    I really wish that if: the device is not supported for IAPs (or the GPS are not installed), Unity would call "OnInitializedFailed" instead of sending us Non-Fatals on Crashlytics.

    Just avoid using in-apps if GPS are not installed.
     
    Brown2Fox likes this.
  24. John_Corbett

    John_Corbett

    Joined:
    May 17, 2019
    Posts:
    151
    Hello @Mese, @tduriga,

    I'm investigating a similar issue at the moment for another client.

    The Core Services team has reportedly fixed this issue. If you could update your core services package to 1.5.2, this problem might be resolved.

    However, since we are not yet mandating that IAP SDK user update to this specific version, we're in the process of catching these exceptions from our calls from our package. We will release this fix in IAP as soon as we can, but there is no ETA for the moment.
     
    tduriga and -chris like this.
  25. Arnaud_Gorain

    Arnaud_Gorain

    Unity Technologies

    Joined:
    Jun 28, 2022
    Posts:
    178
    Hello @Mese @tduriga,

    These exceptions handling from the IAP package will be included in our upcoming 4.5.2 release.
     
  26. Karabin

    Karabin

    Joined:
    Apr 26, 2015
    Posts:
    4
    Hi! Are there any updates?
     
  27. Arnaud_Gorain

    Arnaud_Gorain

    Unity Technologies

    Joined:
    Jun 28, 2022
    Posts:
    178
    Hi @Karabin,

    There was a slight delay with the release, it will be out to the package manager by December 12th.
     
    Last edited: Dec 1, 2022
    Karabin and tessellation like this.
  28. Brown2Fox

    Brown2Fox

    Joined:
    Mar 6, 2017
    Posts:
    7
    Did you mean December 12th?)
     
  29. Arnaud_Gorain

    Arnaud_Gorain

    Unity Technologies

    Joined:
    Jun 28, 2022
    Posts:
    178
    Ah yes! My bad for the typo (Edited the answer)
     
    Brown2Fox likes this.
  30. Arnaud_Gorain

    Arnaud_Gorain

    Unity Technologies

    Joined:
    Jun 28, 2022
    Posts:
    178