Search Issue Tracker

Active

Votes

2

Found in

5.6.0f3

Issue ID

1011778

Regression

No

[IAP] InvalidOperationException: Collection was modified; enumeration operation may not execute

IAP

-

Steps to reproduce:
1. Open user attached project
2. Go to Services tab and import the latest IAP package
3. Play the scene
4. Select a character to buy
5. Press "Buy"
6. Observe the "InvalidOperationException: Collection was modified" output in the console

Expected result: IAP should not throw "InvalidOperationException: Collection was modified" when an item is bought

Reproduced in: 2017.3.2f1, 2017.2.2p1, 2017.1.3p2, 5.6.5p2

Comments (4)

  1. 4007d15ed2d5082cbddacc550be52fda?d=mm

    DavidSof

    Nov 07, 2018 21:13

    Unity 2018.2.14f Using IAP version 1.20.1 ,appears to be due to disabling the GameObject the IAP Button is on as write(KIWASI) ,So to fix use StartCoroutine() and yield return new WaitForSeconds(0.25f) and than Button_ads.SetActive (false);

  2. 26cee5a0c17a97aac8e38e9da93c8ca3?d=mm

    MichiealO

    Sep 13, 2018 08:46

    Receiving this error in Unity 2018.2.6 Using IAP version 1.21.
    In my case, it appears to be in the CodelessIAPListener trying to restore purchases at game start up.

  3. Ce4a736cad84907655e26b2482ba5fb7?d=mm

    Kiwasi

    May 26, 2018 01:17

    The error (at least on my system) appears to be due to disabling the GameObject the IAP Button is on during the success callback. Waiting one frame during the success callback before disabling the GameObject makes the problem go away.

  4. Ce99fdf2f6a90b677b0103e74f2cbb29?d=mm

    toughlucksmith

    Apr 04, 2018 14:25

    I am also experiencing this issue on 2017.1.1f1 with most up to date Unity IAP. The problem goes away when I buy the second time.

    This appears to only be an issue with interacting with the "fake" Unity store. I tested on iPhone and did not see this error in the debug log.

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.