Warning:
[ICODE]
The package cache was invalidated and rebuilt because the following immutable asset(s) were unexpectedly altered:
Packages/com.unity.purchasing/Editor/IAPButtonEditor.cs
Packages/com.unity.purchasing/Editor/IAPGeneratedCredentials.cs.template
Packages/com.unity.purchasing/Plugins/UnityPurchasing/Android/AmazonAppStore.aar
Packages/com.unity.purchasing/Plugins/UnityPurchasing/Android/SamsungApps.aar
Packages/com.unity.purchasing/Plugins/UnityPurchasing/Android/common.aar
Packages/com.unity.purchasing/Plugins/UnityPurchasing/iOS/UnityPurchasing.m
Packages/com.unity.purchasing/Plugins/UnityPurchasing/unitypurchasing.bundle/Contents/Info.plist
Packages/com.unity.purchasing/Plugins/UnityPurchasing/unitypurchasing.bundle/Contents/MacOS/unitypurchasing
Packages/com.unity.purchasing/Runtime/Codeless/CodelessIAPStoreListener.cs
Packages/com.unity.purchasing/Runtime/Codeless/IAPButton.cs
Packages/com.unity.purchasing/Runtime/Codeless/IAPConfigurationHelper.cs
Packages/com.unity.purchasing/Runtime/Codeless/IAPListener.cs
Error: Library/PackageCache/com.unity.purchasing@3.1.0/Runtime/AppleCore/INativeAppleStore.cs(5,42): error CS0122: 'UnityPurchasingCallback' is inaccessible due to its protection level
Error:
Microsoft (R) Visual C# Compiler version 2.9.1.65535 (9d34608e)
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. '/[path to project]/Library/ScriptAssemblies/Purchasing.Common.dll') or sign them to enable side-by-side.```
Error:
Plugin âAssets/Plugins/UnityPurchasing/Bin/Purchasing.Common.dllâ has the same filename as Assembly Definition File âPackages/com.unity.purchasing/Runtime/Common/Purchasing.Common.asmdefâ. Rename the assemblies to avoid hard to diagnose issues and crashes.```
Error:
Microsoft (R) Visual C# Compiler version 2.9.1.65535 (9d34608e)
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. '/[path to project]/Assets/Plugins/UnityPurchasing/Bin/Purchasing.Common.dll') or sign them to enable side-by-side.
I followed these instructions for removing the old IAP completely first:
More errors after I disabled then re-enabled the IAP featureâŚ
Plugin 'Assets/Plugins/UnityPurchasing/Bin/Purchasing.Common.dll' has the same filename as Assembly Definition File 'Packages/com.unity.purchasing/Runtime/Common/Purchasing.Common.asmdef'. Rename the assemblies to avoid hard to diagnose issues and crashes.
Library/PackageCache/com.unity.purchasing@3.1.0/Runtime/SecurityStub/AppleValidator.cs(33,10): error CS0433: The type 'AppleReceipt' exists in both 'Security, Version=1.0.7698.24420, Culture=neutral, PublicKeyToken=null' and 'UnityEngine.Purchasing.SecurityCore, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
Library/PackageCache/com.unity.purchasing@3.1.0/Runtime/SecurityStub/AppleValidator.cs(53,10): error CS0433: The type 'AppleReceipt' exists in both 'Security, Version=1.0.7698.24420, Culture=neutral, PublicKeyToken=null' and 'UnityEngine.Purchasing.SecurityCore, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'```
```Library/PackageCache/com.unity.purchasing@3.1.0/Runtime/SecurityStub/CrossPlatformValidator.cs(43,16): error CS0433: The type 'IPurchaseReceipt' exists in both 'Security, Version=1.0.7698.24420, Culture=neutral, PublicKeyToken=null' and 'UnityEngine.Purchasing.SecurityCore, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'```
```Library/PackageCache/com.unity.purchasing@3.1.0/Runtime/SecurityStub/GooglePlayReceipt.cs(32,35): error CS0433: The type 'IPurchaseReceipt' exists in both 'Security, Version=1.0.7698.24420, Culture=neutral, PublicKeyToken=null' and 'UnityEngine.Purchasing.SecurityCore, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'```
```Library/PackageCache/com.unity.purchasing@3.1.0/Runtime/AppleCore/INativeAppleStore.cs(5,42): error CS0122: 'UnityPurchasingCallback' is inaccessible due to its protection level```
@Gillissie It looks like you havenât deleted /Assets/Plugins/UnityPurchasing. Or you did, and then you reimported IAP from the Services window. Donât do that, we will be removing the Services window altogether in a future version of Unity. Install IAP (only) from Package Manager.
The whole thing is scuffed ATM. You need to import IAP from the Services Window and cherry pick only the demo related files to have access to the Demo scene. There are demo scripts named demo outside of the demo folder BTW SMH.
Then for the whole thing to work you have to manually add UNITY_PURCHASING to your build define symbols. None of this is documented and makes everyone waste their time.
How about you guys at unity âDonât do thatâ? ^^^^
Correct, donât do that (for now, itâs not the final design!). Well, you can do that, but youâll likely run into errors. You donât want to import again after youâve already deleted the folders. Donât do that, as youâve instructed not to. Itâs a bug (actually a lingering design feature) that you will want to avoid, so donât do that! We are removing the services window altogether in a future release, as mentioned. Donât add UNITY_PURCHASING either, itâs no longer needed. We are aware of the demo prefab outside of the expected folder, we are working on that too.
I was on 2020.3.2f1 and tried upgrading to 2020.3.6f1 and now have these kind of Errors:
type 'AppleReceipt' exists in both 'Security, Version=1.0.7698.24420, Culture=neutral, PublicKeyToken=null' and 'UnityEngine.Purchasing.SecurityCore
I thought 2020.3 was supposed to be a LTS version? Why are updates causing breaking changes???
Iâve removed the /Assets/Plugins/UnityPurchasing folder ⌠now Iâm having this error:
The type or namespace name 'ProductCatalog' could not be found (are you missing a using directive or an assembly reference?)
EDIT:
Ok, I had to add UnityEngine.Purchasing.Stores to my asmdef to fix the above error.
But now I canât get my AppleTangle and GooglePlayTangle to compile ⌠guess I will have to regenerate them or something.
You just need to wrap them in Try/Catch block and catch the NotImplemented exception. The Receipt Validator only works on devices, not in the Editor. The Sample IAP Project v2 shows an example in IAPManager.cs https://discussions.unity.com/t/700293/3
Hi I just got this same flow of errors after upgrading Unity version. (LTS 2019.4.17 â 2019.4.40)
For those of us who have not actually touched anything, how to solve?
A step by step guide would be much appreciated. I get messages like: "
âPackages/com.unity.purchasing/Editor/AppleIncRootCertificate.cerâ conflicts with:
âAssets/Plugins/UnityPurchasing/Editor/AppleIncRootCertificate.cerâ (current owner)" An have no idea which one to delete.
Make a project back up, and delete your entire /Library folder. Are you using ASMDEFs? If you still have issues, compare to a brand new project and add IAP and see if you receive the same error.
error CS1704: An assembly with the same simple name âPurchasing.Commonâ has already been imported. Try removing one of the references (e.g. how to fix it ,please help out
Library/PackageCache/com.unity.purchasing@4.0.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â. , this also how to fix it
Please test and compare to a new/empty project. Youâll want to be using the latest IAP which is currently 4.4.1. You might also try just deleting the /Library folder (after making a full project backup).
Library\PackageCache\com.unity.purchasing@4.4.1\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â
Can you try deleting the /Library folder (after making a full project backup) and let me know if that resolves the issue.
If that doesnât resolve the issue, can you please share a copy of your Packages/manifest.json file and let me know what version of Editor you are using so we can identify what is causing the conflict. Feel free to send the file to me in a DM