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

IAP Breaking the project. TypeLoadException

Discussion in 'Unity IAP' started by marpione, Oct 17, 2019.

  1. marpione

    marpione

    Joined:
    Apr 16, 2016
    Posts:
    26
    Hello, after installing the IAP I started getting errors and breaking my project completely. I install the IAP write my code and got it all working. But after closing and opening the project. I found that sometimes IAP namespaces are missing, reimporting sometimes solves the issue but usually, I have to reopen the unity editor every time I face errors. Other third-party and my namespace are also not loading when reimporting the IAP.

    Basically I get this error first whenever I select a button with the IAPButton component added.

    Code (CSharp):
    1. TypeLoadException: Could not find method due to a type load error
    2. UnityEditor.UIElements.InspectorElement+<CreateIMGUIInspectorFromEditor>c__AnonStorey1.<>m__0 () (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorElement.cs:501)
    3. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    Not the same case but a similar one is also on the issue tracker here: https://issuetracker.unity3d.com/is...occurs-while-using-unityengine-dot-purchasing

    I get these errors when starting the editor.

    Code (CSharp):
    1. Error: Could not load signature of UnityEngine.Purchasing.FakeUDPExtension:GetUserInfo due to: Could not load file or assembly 'UDP, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. assembly:UDP, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null type:<unknown type> member:(null) signature:<none>
    2. (Filename: C:\buildslave\unity\build\Runtime/Mono/MonoAttributeHelpers.cpp Line: 372)
    3.  
    4. Unloading broken assembly Assets/Plugins/UnityPurchasing/Bin/Stores.dll, this assembly can cause crashes in the runtime
    5. (Filename: C:\buildslave\unity\build\Runtime/Mono/MonoManager.cpp Line: 1231)
    When I reimport the package at first I get these errors.

    Code (CSharp):
    1. Assembly 'Library/ScriptAssemblies/Assembly-CSharp-firstpass.dll' will not be loaded due to errors:
    2. Reference has errors 'Stores'.
    3. Assembly 'Library/ScriptAssemblies/Assembly-CSharp.dll' will not be loaded due to errors:
    4. Reference has errors 'Assembly-CSharp-firstpass'.
    5. Assembly 'Library/ScriptAssemblies/Assembly-CSharp-Editor-firstpass.dll' will not be loaded due to errors:
    6. Reference has errors 'Assembly-CSharp-firstpass'.
    7. Assembly 'Library/ScriptAssemblies/Assembly-CSharp-Editor.dll' will not be loaded due to errors:
    8. Reference has errors 'Assembly-CSharp'.
    9. Symbol file LoadedFromMemory doesn't match image C:\Users\ugurt\Documents\UnityProjects\ProjectPachinko\Library\PackageCache\com.unity.ext.nunit@1.0.0\net35\unity-custom\nunit.framework.dll
    10. Assembly 'Assets/Plugins/UnityPurchasing/Bin/Stores.dll' will not be loaded due to errors:
    11. Unable to resolve reference 'UDP'. Is the assembly missing or incompatible with the current platform?
    12. Reference validation can be disabled in the Plugin Inspector.
    13. Assembly 'Assets/Plugins/UnityPurchasing/Bin/Editor.dll' will not be loaded due to errors:
    14. Unable to resolve reference 'UDP'. Is the assembly missing or incompatible with the current platform?
    15. Reference validation can be disabled in the Plugin Inspector.
    This issue is happening on Windows and Mac


    Thank you for your help
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    After I was able to install IAP, I was able to use a Codeless button. This test was on 2018.4.61. However I saw some issues when importing from the Services tab, I might recommend installing IAP from the Asset Store.
     
  3. marpione

    marpione

    Joined:
    Apr 16, 2016
    Posts:
    26
    I'm importing it from Asset Store first, After enabling the IAP service I'm also updating the package. Update button keeps active and stays as Update. Usually, it starts to work after installing from services. The problem occurs when I reopen the project or change some stuff. I usually force to restart the project a couple of times to get it working for a little while. I will open a new black project and try it there. If the problem happens again I will post the project. The version I'm working on is 2019.2.4f1.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I would recommend the following steps:

    * Open a new/empty project
    * Go to the Services tab
    * Enable IAP, and follow the prompts. Wait a bit on each one as the window refreshes
    * It will prompt you through the install process, and a wizard dialog (when using Unity 2019) will appear that you go through
    * When the wizard completes, you are done. Open the IAPDemo scene to confirm

    Alternatively, you can follow these steps

    * Open a new/empty project
    * In Unity, open the Asset Store tab, and search and install Unity IAP from the Asset Store, and import and add to your project
    * It will also prompt you through the same Wizard process as previously
    * You are done.
     
    Last edited: Oct 24, 2019