Search Unity

Two classes with the same name in unity IAP cause an error in MacOS Standalone mode

Discussion in 'Unity IAP' started by unity_SRZXyHN7P3fFcA, Jun 12, 2021.

  1. unity_SRZXyHN7P3fFcA

    unity_SRZXyHN7P3fFcA

    Joined:
    Oct 27, 2019
    Posts:
    10
    Trying to build addressable asset groups fails with this error.

    Code (CSharp):
    1. Library/PackageCache/com.unity.purchasing@3.1.0/Runtime/Stores/BaseStore/NativeStoreProvider.cs(96,24): error CS0433: The type 'OSXStoreBindings' exists in both 'UnityEngine.Purchasing.AppleMacos, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' and 'UnityEngine.Purchasing.AppleMacosStub, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
    I tried to remove and reinstall the IAP package, no success. Tried to remove it, clear any cached versions of it in PackageCache folders then reinstall, but I still get this error which breaks building addressable assets.
     
  2. unity_SRZXyHN7P3fFcA

    unity_SRZXyHN7P3fFcA

    Joined:
    Oct 27, 2019
    Posts:
    10
    @JeffDUnity3D

    Mentioning you here because I came across a similar thread for iOS. The same issue happens to me on MacOS on 3.1.0, as well as when I upgraded to 3.2.2.

    I don't know if this is at all helpful, but the Runtime folder in the package contains in fact classes with duplicate names, under subfolders like Apple and AppleStub, and like AppleMacos and AppleMacosStub. Each of these pairs of assemblies shouldn't be simultaneously referenced, I believe. If this sheds any light on the possible cause, I'm happy to test any steps you might advise me to test.
     
  3. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please provide specific steps to reproduce. I've tried by creating an addressable, no issue.
     
  4. unity_SRZXyHN7P3fFcA

    unity_SRZXyHN7P3fFcA

    Joined:
    Oct 27, 2019
    Posts:
    10
    Thanks @JeffDUnity3D.

    Sorry it seems it was my bad. I was switching platforms, and the error automatically went away after I built. I didn't expect such an error, which appears code-structure-related, to go away with a build, but I think this is what happened.
     
  5. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Yes, this is still a valid issue when mixing addressables and IAP, sorry about that. I was able to reproduce by switching platforms. But even then, there appears to still be a problem. IAP dev is looking into it.