INativeStore is inaccessible

Unity version: 2020.3.17f1 LTS
OS: windows 10

I’ve added “com.unity.purchasing”: “3.2.3” to new Project and gets some errors…

  • Library\PackageCache\com.unity.purchasing@3.2.3\Runtime\AppleCore\INativeAppleStore.cs(3,44): error CS0122: ‘INativeStore’ is inaccessible due to its protection level

  • Library\PackageCache\com.unity.purchasing@3.2.3\Runtime\AppleCore\INativeAppleStore.cs(5,42): error CS0122: ‘UnityPurchasingCallback’ is inaccessible due to its protection level

  • Microsoft (R) Visual C# Compiler version 3.5.0-dev-20359-01 (8da8ba0c)
    Copyright (C) Microsoft Corporation. All rights reserved.

error CS1704: An assembly with the same simple name ‘Purchasing.Common’ has already been imported. Try removing one of the references (e.g. ‘C:\Users\rever\Desktop\Gravity-Flight-master\Library\ScriptAssemblies\Purchasing.Common.dll’) or sign them to enable side-by-side.

  • Library\PackageCache\com.unity.purchasing@3.2.3\Runtime\SecurityStub\AppleValidator.cs(33,10): error CS0433: The type ‘AppleReceipt’ exists in both ‘Security, Version=1.0.7016.24189, Culture=neutral, PublicKeyToken=null’ and ‘UnityEngine.Purchasing.SecurityCore, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’

  • Library\PackageCache\com.unity.purchasing@3.2.3\Runtime\SecurityStub\AppleValidator.cs(53,10): error CS0433: The type ‘AppleReceipt’ exists in both ‘Security, Version=1.0.7016.24189, Culture=neutral, PublicKeyToken=null’ and ‘UnityEngine.Purchasing.SecurityCore, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’

  • Library\PackageCache\com.unity.purchasing@3.2.3\Runtime\SecurityStub\GooglePlayReceipt.cs(32,35): error CS0433: The type ‘IPurchaseReceipt’ exists in both ‘Security, Version=1.0.7016.24189, Culture=neutral, PublicKeyToken=null’ and ‘UnityEngine.Purchasing.SecurityCore, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’

  • Library\PackageCache\com.unity.purchasing@3.2.3\Runtime\SecurityStub\CrossPlatformValidator.cs(43,16): error CS0433: The type ‘IPurchaseReceipt’ exists in both ‘Security, Version=1.0.7016.24189, Culture=neutral, PublicKeyToken=null’ and ‘UnityEngine.Purchasing.SecurityCore, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’

  • Library\PackageCache\com.unity.purchasing@3.2.3\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’

What to do?

1 Like

Chiming in here hoping it gets some traction. Got the same error, just with unity 2020.3.18f1

I’m using 2020.3.18f1 and don’t see any errors:

  • From the Hub Projects tab, I choose New (2020.3.18f1)
  • I selected the 3D template
  • Once it loaded, I opened Package Manager,
  • I chose “Unity Registry” under Packages and imported In App Purchasing 4.0.3 without issue
  • I pressed Play to view the SampleScene, no errors or warnings Console

For me this error went away after switching platform from PC to iOS; iOS to Android; and then a full reimport targetting PC. We always chalk this sort of thing up to “unity being unity” :p.

Hopefully the OP can try a reimport too.

I seem to be having the same issue. It does not go away by removing the Library and obj folders and doing a full reimport. I have tried 3.x and 4.x versions of the purchasing plugin in packages manager.

Does this happen on a brand new project? What version of Unity? I am not able to reproduce, please see my steps above.

I were not able to reproduce the issue with a brand new project. But I also got the old project fixed with the following:

I had 2020.1.18f1 and Unity Hub Beta 3.x which I downgraded to 2.x because I had trouble installing android build tools with it. After that the unity version I were using disappeared, and I selected 2020.1.4f1 to open the project with, and the errors disappeared.

i got the exact same issue while switching from unity 19.4.19f1 to 2020.3.20f1. I tried importing latest unity purchasing package, but doesn’t help. it was completely working fine with unity 2019.

Please compare to a new project and import IAP. If you are upgrading, be sure to delete /Assets/Plugins/UnityPurchasing (the old Asset Store version)

2 Likes

I have the same issue but with many more packages too after upgrading to 2020 from previous version

Same advice applies. Are you using IAP? Are you using ASMDEFs? Hopefully you have a back up that you can revert to while you troubleshoot.