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

The type 'IPurchaseReceipt' exists in both Security ' and 'UnityEngine.Purchasing.SecurityCore

Discussion in 'Unity IAP' started by BeorGames, Oct 17, 2021.

  1. BeorGames

    BeorGames

    Joined:
    Jul 28, 2018
    Posts:
    65
    Hello!

    It's been a while that I'm receiving this duplicate errors when I start the editor, but until today I could just clear and move on with my life.

    The problem is that I had to update the editor to a newer version because of the Localization package and now these errors won't go away, there seems to be some classes duplicated inside the Purchasing Package, I have already uninstalled and reinstalled a couple times, tried deleting the @purchasing folder inside the Packages, but nothing seems to work. Here follows the main errors:
    upload_2021-10-17_19-45-59.png
    upload_2021-10-17_19-46-12.png upload_2021-10-17_19-46-23.png upload_2021-10-17_19-46-33.png
    and
    Library\PackageCache\com.unity.purchasing@3.0.2\Runtime\WinRTStub\Factory.cs(15,23): error CS0433: The type 'IWindowsIAP' exists in both 'UnityEngine.Purchasing.WinRTCore, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' and 'winrt, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'

    These are the ones that clearing the editor won't go away, than there are another 74 errors that when I hit Clear they'll disappear, here's a snippet of my console
    upload_2021-10-17_19-49-19.png
     
  2. BeorGames

    BeorGames

    Joined:
    Jul 28, 2018
    Posts:
    65
    I managed to solve the first error by my own, deleted the folder Unity Purchasing inside of Assets/Plugins, than I deleted the folder Library\PackageCache\com.unity.purchasing@3.0.2 and finally uninstalled the Unity purchasing. When I reinstalled it the errors were gone.

    All the others (Nearly 70 errors) are still there every time unity compiles a script, but I just hit Clear and get rid of them.

    If you have any idea what's happening I'd appreciate.
     
  3. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    If you review the release notes, it mentions the need to remove /Assets/Plugins/Unity Purchasing folders. Ensure you no longer use the Services window to install or update IAP, it's done now via Package Manager (only). The In App Purchasing library 4.1.0 has just been released. You might want to compare to a new/empty project and add IAP.
     
    BeorGames likes this.
  4. BeorGames

    BeorGames

    Joined:
    Jul 28, 2018
    Posts:
    65
    Hello Jeff,
    Thanks for your answer, I managed to work it out, the project is running just fine, but at every update in the editor I get these errors:
    upload_2021-10-19_21-55-53.png
    upload_2021-10-19_21-56-23.png

    Should I delete it all again and reinstall? I'm using only the package manager to make these changes
     
  5. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Sorry I would not know. I would recommend that you first make a full project backup regardless. You might want to start with a new project to compare.