Search Unity

Problem error Unity IAP 1.23

Discussion in 'Unity IAP' started by RainbowLab, Oct 19, 2019.

  1. RainbowLab

    RainbowLab

    Joined:
    May 20, 2019
    Posts:
    12
    I have just updated Unity IAP to the latest version released yesterday on the Unity Asset Store, but once the guided installation is complete I cannot install the IAP Catalog, and in the console I continuously receive the following error message:

    Code (CSharp):
    1. UnityException: get_unityVersion is not allowed to be called from a ScriptableObject constructor (or instance field initializer), call it in OnEnable instead. Called from ScriptableObject 'ProductCatalogEditor'.
    2. See "Script Serialization" page in the Unity Manual for further details.
    3. UnityEditor.Purchasing.UdpSynchronizationApi.CheckUdpAvailability () (at <8d2d05e7bd5745cca0a5537a3fd6f38c>:0)
    In addition, purchases in apps on iOS devices (version 13.1.3) do not work properly.


    I need help because I can't publish my game.
    I use the latest stable version of Unity 2019.2.9f.
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please elaborate, "install the IAP catalog". Can you provide steps to reproduce?
     
  3. triple_why

    triple_why

    Joined:
    Jun 9, 2018
    Posts:
    47
    Hello,

    I'm experiencing the same situation. I updated IAP to 1.23.0 via services window. I observe these behaviors:

    * If I start game while iap catalog window is open, I get the error message* repetitively (~200 / sec). But game and iap system run fine. When I stop game error messages continues, and when I close iap catalog window error messages stop. Similar error messages are also issued 1 or 2 times, see attached screenshot.
    * If I start game while iap catalog window is closed, I don't get any error message and everything runs fine. Opening iap catalog window and/or stopping game don't cause any error message.

    I tried removing/reinstallig/reimporting UnityPurchasing and UDP plugins, disabling/enabling IAP via services window, uninstalling in app purchasing package (2.0.6) via package manager (but it got reinstalled by iap installer), several trial-errors over iap installer and iap updater.

    For now, I'm working without playing the game while iap catalog window open. Any help on finding a cause or a fix is appreciated.

    (Unity 2019.2.2, windows 10)

    * The error message:
    UnityException: get_unityVersion is not allowed to be called from a ScriptableObject constructor (or instance field initializer), call it in OnEnable instead. Called from ScriptableObject 'ProductCatalogEditor'.
    See "Script Serialization" page in the Unity Manual for further details.
    UnityEditor.Purchasing.UdpSynchronizationApi.CheckUdpAvailability () (at <97020ad831c24ecbaad86b2f4fbca9f8>:0)
    UnityEditor.Purchasing.ProductCatalogEditor..cctor () (at <97020ad831c24ecbaad86b2f4fbca9f8>:0)
    Rethrow as TypeInitializationException: The type initializer for 'UnityEditor.Purchasing.ProductCatalogEditor' threw an exception.
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <ad04dee02e7e4a85a1299c7ee81c79f6>:0)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <ad04dee02e7e4a85a1299c7ee81c79f6>:0)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <ad04dee02e7e4a85a1299c7ee81c79f6>:0)
    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:359)
    UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:353)
    UnityEditor.HostView.SendUpdate () (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:465)
    UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:303)
     

    Attached Files:

  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Yes, I can reproduce and will let the team know. In the meantime, you can safely play your game with the catalog window closed.
     
    triple_why likes this.
  5. mariano_mediamonks

    mariano_mediamonks

    Joined:
    Jul 15, 2016
    Posts:
    1
    Hi jeff, I'm having the same issue, Did you find a solution?
    Thanksm,
     
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    For now, you would want to close the Catalog window before you play your game. You only need it open when you first enter your products. After that, you can keep it closed. It is not necessary to keep the Catalog window open while you run your game in the Editor. We will try to address this in an upcoming release.
     
  7. ngochoadev

    ngochoadev

    Joined:
    Nov 14, 2019
    Posts:
    2
    This problem still happen to my project @JeffD
     
  8. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You can use the workaround mentioned above.
     
  9. jtbentley

    jtbentley

    Joined:
    Jun 30, 2009
    Posts:
    1,397
    For anyone encountering this - and the error persists even after the window has been closed, you will find you cannot close the window and restarting unity will not fix the error.

    If you're basically in this error-spamming hellscape, goto Window --> Layouts --> Reset Factory settings, and that will quieten the error.
     
    cy118, cuzner, mumarmukhtar and 2 others like this.
  10. cuzner

    cuzner

    Joined:
    Oct 1, 2015
    Posts:
    11
    Well, I am pretty disappointed with the Unity moderators.
    This is a re-occurring bug and is very problematic. To just tell us to "Follow the work-around" and then just ignore the issue for months is not how I would expect a professional agile software company to behave.

    In my case after I had opened the catalog window and closed it, the errors appeared (had thousands after 30 seconds), nothing would work, could not build and could not re-open the catalog at any point.
    I thought it was my scripts so I disabled every single one and nothing changed!

    This bug should be fixed as a priority otherwise Unity is going to frustrate and lose customers.

    Thanks to @jtbentley I have been able to make some progress.
    Yours is the only solution that worked for me. Was struggling with this for days! Hope there are no more issues.
     
  11. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    It sounds like you have a different problem. The problem described here only happens when you run the game with the catalog window open. You only need to have the catalog open once, when you first define your products (or edit them later). Then you close the window, and run your game with no errors. If you are still seeing errors after closing the window, then please show a screenshot here.
     
  12. cuzner

    cuzner

    Joined:
    Oct 1, 2015
    Posts:
    11
    Thanks for the reply Jeff,
    Since I followed @jtbentley suggestion I have not seen the issue re-occur so far. If it does I will post a screen shot.
     
  13. Bachyabal

    Bachyabal

    Joined:
    Mar 10, 2020
    Posts:
    2
  14. Bachyabal

    Bachyabal

    Joined:
    Mar 10, 2020
    Posts:
    2
    It's Working @jtbentley
    Go Window --> Layouts --> Reset Factory settings
    Then Restart Unity.
     
  15. better_walk_away

    better_walk_away

    Joined:
    Jul 12, 2016
    Posts:
    291
    I have just come across this issue. This bug still exists in 2018.4.22f1.
     
  16. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    It's not related to Unity version, it's IAP. Do you see the error after closing the catalog window and resetting the window layout?
     
    Last edited: Aug 11, 2020
    spg82 likes this.
  17. romasIOS

    romasIOS

    Joined:
    Aug 5, 2019
    Posts:
    1
    IAP Catalog always fails!!! Please help!
    When I restart Unity (version 2019.2.14f1) I can open IAP Catalog tab (menu Window->Unity IAP->IAP Catalog). But! I dock this tab near Inspector tab. When I launch my project in unity I get 3 identically errors:

    UnityException: get_unityVersion is not allowed to be called from a ScriptableObject constructor (or instance field initializer), call it in OnEnable instead. Called from ScriptableObject 'ProductCatalogEditor'.
    See "Script Serialization" page in the Unity Manual for further details.
    UnityEditor.Purchasing.UdpSynchronizationApi.CheckUdpAvailability () (at <5432628c240348a2818fdcf82b6b6906>:0)
    UnityEditor.Purchasing.ProductCatalogEditor..cctor () (at <5432628c240348a2818fdcf82b6b6906>:0)
    Rethrow as TypeInitializationException: The type initializer for 'UnityEditor.Purchasing.ProductCatalogEditor' threw an exception.

    This error don't crash my project.
    But after that i can't switch to the IAP Catalog tab! In the console I get endless errors:

    UnityException: get_unityVersion is not allowed to be called from a ScriptableObject constructor (or instance field initializer), call it in OnEnable instead. Called from ScriptableObject 'ProductCatalogEditor'.
    See "Script Serialization" page in the Unity Manual for further details.
    UnityEditor.Purchasing.UdpSynchronizationApi.CheckUdpAvailability () (at <5432628c240348a2818fdcf82b6b6906>:0)
    UnityEditor.Purchasing.ProductCatalogEditor..cctor () (at <5432628c240348a2818fdcf82b6b6906>:0)
    Rethrow as TypeInitializationException: The type initializer for 'UnityEditor.Purchasing.ProductCatalogEditor' threw an exception.
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <567df3e0919241ba98db88bec4c6696f>:0)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <567df3e0919241ba98db88bec4c6696f>:0)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <567df3e0919241ba98db88bec4c6696f>:0)
    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:359)
    UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:353)
    UnityEditor.HostView.SendUpdate () (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:465)
    UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:303)

    while don't close IAP Catalog tab or switch to another tab. I can no longer open it from the menu. I get the error:

    UnityException: get_unityVersion is not allowed to be called from a ScriptableObject constructor (or instance field initializer), call it in OnEnable instead. Called from ScriptableObject 'ProductCatalogEditor'.
    See "Script Serialization" page in the Unity Manual for further details.
    UnityEditor.Purchasing.UdpSynchronizationApi.CheckUdpAvailability () (at <5432628c240348a2818fdcf82b6b6906>:0)
    UnityEditor.Purchasing.ProductCatalogEditor..cctor () (at <5432628c240348a2818fdcf82b6b6906>:0)
    Rethrow as TypeInitializationException: The type initializer for 'UnityEditor.Purchasing.ProductCatalogEditor' threw an exception.
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <567df3e0919241ba98db88bec4c6696f>:0)

    Restart Unity helps.But everything starts over again!!!
     
  18. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please provide specific steps to reproduce on a new project. Does it work correctly if you close the Catalog window after you're done entering your products?