Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Exception thrown while invoking [DidReloadScripts] method 'UnityEditor.Purchasing.UnityIAPInstaller:

Discussion in 'Unity IAP' started by alphadogware, Aug 27, 2019.

Thread Status:
Not open for further replies.
  1. alphadogware

    alphadogware

    Joined:
    Nov 15, 2017
    Posts:
    75
    Exception thrown while invoking [DidReloadScripts] method 'UnityEditor.Purchasing.UnityIAPInstaller:Install ()' : ReflectionTypeLoadException: Exception of type 'System.Reflection.ReflectionTypeLoadException' was thrown.
    System.Reflection.Assembly.GetTypes () (at <ad04dee02e7e4a85a1299c7ee81c79f6>:0)
    UnityEditor.Purchasing.UnityIAPInstaller+<>c.<GetPurchasing>b__17_0 (System.Reflection.Assembly assembly) (at Assets/Plugins/UnityPurchasing/Editor/UnityIAPInstaller.cs:102)
    System.Linq.Enumerable+<SelectManyIterator>d__167`3[TSource,TCollection,TResult].MoveNext () (at <fbb5ed17eb6e46c680000f8910ebb50c>:0)
    System.Linq.Enumerable+WhereSelectEnumerableIterator`2[TSource,TResult].MoveNext () (at <fbb5ed17eb6e46c680000f8910ebb50c>:0)
    System.Linq.Enumerable.TryGetFirst[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Boolean& found) (at <fbb5ed17eb6e46c680000f8910ebb50c>:0)
    System.Linq.Enumerable.FirstOrDefault[TSource] (System.Collections.Generic.IEnumerable`1[T] source) (at <fbb5ed17eb6e46c680000f8910ebb50c>:0)
    UnityEditor.Purchasing.UnityIAPInstaller.GetPurchasing () (at Assets/Plugins/UnityPurchasing/Editor/UnityIAPInstaller.cs:100)
    UnityEditor.Purchasing.UnityIAPInstaller.EnablePurchasingService () (at Assets/Plugins/UnityPurchasing/Editor/UnityIAPInstaller.cs:481)
    UnityEditor.Purchasing.UnityIAPInstaller.Install () (at Assets/Plugins/UnityPurchasing/Editor/UnityIAPInstaller.cs:329)

    Getting this error when I run my game in the editor. I have tried reimporting all, restarting unity multiple times, switching to .net 4.0, reimporting all packages, clearing temp & libraries folders and reimporting IAP.

    Anyone have a fix for this in 2019.2.2f1? I'm not finding much more than what I have already tried. Any help on this issue is greatly appreciated. Thanks in advance.
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
  3. alphadogware

    alphadogware

    Joined:
    Nov 15, 2017
    Posts:
    75
    First off, thanks for the quick reply. So what I'm seeing is a known bug that is being worked on then? If so, then I'll work on something else while I wait then.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Yes, you might have better luck with Unity 2019.1
     
  5. alphadogware

    alphadogware

    Joined:
    Nov 15, 2017
    Posts:
    75
    I will try those. thanks.
     
  6. Coco07

    Coco07

    Joined:
    Mar 7, 2017
    Posts:
    49
    Unity 2019.2.7f2

    Is there anything new about this issue? I did not know that disabling the Analytics service also disables the In App Purchasing service. When reactivated, the following error message appears. I already deleted the 3 folders UnityPurchasing, UnityChannel and UDP, set up the services and loaded IAP from the asset-store, then imported all 3 .unitypackages. Unfortunately, this error still occurs when starting or opening the project:

    Exception thrown while invoking [DidReloadScripts] method 'UnityEditor.Purchasing.UnityIAPInstaller: Install ()': ReflectionTypeLoadException: Exception of type 'System.Reflection.ReflectionTypeLoadException' was thrown.
    System.Reflection.Assembly.GetTypes () (at <599589bf4ce248909b8a14cbe4a2034e>: 0)
    UnityEditor.Purchasing.UnityIAPInstaller + <> c. <GetPurchasing> b__17_0 (System.Reflection.Assembly assembly) (at Assets / Plugins / UnityPurchasing / Editor / UnityIAPInstaller.cs: 102)
    System.Linq.Enumerable + <SelectManyIterator> d__167`3 [TSource, TCollection, TResult] .MoveNext () (at <fbb5ed17eb6e46c680000f8910ebb50c>: 0)
    System.Linq.Enumerable + WhereSelectEnumerableIterator`2 [TSource, TResult] .MoveNext () (at <fbb5ed17eb6e46c680000f8910ebb50c>: 0)
    System.Linq.Enumerable.TryGetFirst [TSource] (System.Collections.Generic.IEnumerable`1 [T] source, System.Boolean & found) (at <fbb5ed17eb6e46c680000f8910ebb50c>: 0)
    System.Linq.Enumerable.FirstOrDefault [TSource] (System.Collections.Generic.IEnumerable`1 [T] source) (at <fbb5ed17eb6e46c680000f8910ebb50c>: 0)
    UnityEditor.Purchasing.UnityIAPInstaller.GetPurchasing () (at Assets / Plugins / UnityPurchasing / Editor / UnityIAPInstaller.cs: 100)
    UnityEditor.Purchasing.UnityIAPInstaller.EnablePurchasingService () (at Assets / Plugins / UnityPurchasing / Editor / UnityIAPInstaller.cs: 481)
    UnityEditor.Purchasing.UnityIAPInstaller.Install () (at Assets / Plugins / UnityPurchasing / Editor / UnityIAPInstaller.cs: 329)
     
  7. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Nothing new yet, the next version in a week or two will address these issues.
     
  8. Coco07

    Coco07

    Joined:
    Mar 7, 2017
    Posts:
    49
    Great, thanks for the super fast response :)
     
  9. Coco07

    Coco07

    Joined:
    Mar 7, 2017
    Posts:
    49
    Unity Version: 2019.2.10f1

    Is there anything new about this? There were now 2-3 updates for Unity and the problem has gotten worse than improved. If I want to update IAP to the latest version, a window opens with the title: "The IAP Service is currently disabled" (attached). However, the service is activated (also attached). I have already tried the services to disable, re-enable,re-opened Unity, login again in the service tab, I have already deleted all old IAP folders (UDP, UnityPurchasing, UnityChannel) and tried to reinstall, but nothing helps. Bildschirmfoto 2019-10-26 um 16.57.17.png Bildschirmfoto 2019-10-26 um 16.59.22.png
     
  10. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    That error likely means that you may have removed/disabled the Purchasing package under Package Manager. Unity IAP (currently) requires the Asset Store package, and the Package Manager package. You'll want to test and compare with a brand new/empty project and import IAP, you should see it succeed.
     
  11. Coco07

    Coco07

    Joined:
    Mar 7, 2017
    Posts:
    49
    Thank you for your prompt reply!
    The package in the Package Manager is available and up to date. Unfortunately, I still can not solve the problem.
    It works flawlessly with a new project. But I have a big project and can not simply "make it new". Is there a way to completely reinstall IAP with all related files?

    edit:
    I was able to solve the problem by reinstalling the PlayServiceResolver to the latest version.
     
    Last edited: Oct 28, 2019
  12. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Can you elaborate how this separate package affects IAP?
     
  13. Coco07

    Coco07

    Joined:
    Mar 7, 2017
    Posts:
    49
    Sadly, I can not do that. I noticed that the bug does not occur on Android (I made a copy and installed another version of the PlayServiceResolver because of another bug). Since this is the only difference between the two projects, I came up with the idea to simply delete the PlayServiceResolver in the iOS_Project and it worked immediately.
     
  14. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    So inconclusive and possibly not related, but thanks for sharing.
     
Thread Status:
Not open for further replies.