Help - In-app purchasing ...upgrade gone very wrong

Hi
I am on v2019.4.3
I was unable to upload my new apk to Google Play because it said I was on an old version of Play Billing Library
So I went to in-app purchasing in Unity and imported the latest version. I have since found out that I should have done this through the asset store - unfortunately the horse has bolted.

i got this 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.
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. ‘E:\Development\masterchange2023\Library\ScriptAssemblies\Purchasing.Common.dll’) or sign them to enable side-by-side.

I found some advice so followed that and deleted the library folder
Now when I open the project I get a load more errors - see attached as too many to copy into here

So I then tried to revert to a previous commit but this doesn’t solve the problem

I think it is now time to ask for some help on how to fix before I do any more damage…
thanks


This guy recently had success:

OTHERWISE…

How to troubleshoot build failures:

First, make a blank project with a single blank scene and prove that it builds successfully.

If the blank project does NOT build, go fix your Unity installation or your other tools, such as Android SDK, NDK, JDK, etc. It may even be necessary to change to a different version of Unity3D. It is generally best to stay with LTS versions of Unity3D.

Until you can build a blank project to the target platform, don’t fiddle with anything else.

Once you can build a blank project, now bisect the problem by bringing over parts of your current project and building it one subsystem at a time, perhaps stubbing things out that might trigger compiler errors.

Most often things that prevent building are third-party libraries such as Firebase.

Once you identify the subsystem, go to the documentation for it and make sure you are doing it correctly.

It may also be helpful to work through a tutorial or two for whatever subsystem is making the build fail.

Android build not building:

Recently (circa July 2022) there have been reports of Unity’s installer failing to install the Android Tools.

Here was how I brought up Unity2020.3.41 and the Android SDK 31 on October 30, 2022 (edited on August 23, 2023 to include Android SDK 33…):

Android Gradle errors and other related stuff:

thanks for the quick response - perhaps i misunderstand you but i know what caused the problem. it was upgrading in-app purchasing via the services window. Everything was fine before that.

So I guess the first question is whether there a way to roll this back - pulling the last good code from github didn’t do this so is there anything else i can do before I start rebuilding the application from scratch?

I was within a hairs breadth of publishing to Google Play but their new(ish) policy meant i had to make this change and now i have this major problem

I am using the LTS version of 2019. i did try upgrading to 2021 lts and these are my new errors
I will have to downgrade to 2019 once fixed but perhaps this will help?

error CS1704: An assembly with the same simple name ‘Purchasing.Common’ has already been imported. Try removing one of the references (e.g. ‘E:\Development\masterchange2023\Assets\Plugins\UnityPurchasing\Bin\Purchasing.Common.dll’) or sign them to enable side-by-side.
error CS1704: An assembly with the same simple name ‘Purchasing.Common’ has already been imported. Try removing one of the references (e.g. ‘E:\Development\masterchange2023\Assets\Plugins\UnityPurchasing\Bin\Purchasing.Common.dll’) or sign them to enable side-by-side.
Library\PackageCache\com.unity.purchasing@4.1.5\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’
Library\PackageCache\com.unity.purchasing@4.1.5\Runtime\SecurityStub\GooglePlayReceipt.cs(32,38): error CS0433: The type ‘IPurchaseReceipt’ exists in both ‘Security, Version=1.0.7807.33496, Culture=neutral, PublicKeyToken=null’ and ‘UnityEngine.Purchasing.SecurityCore, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’
Library\PackageCache\com.unity.purchasing@4.1.5\Runtime\SecurityStub\CrossPlatformValidator.cs(43,16): error CS0433: The type ‘IPurchaseReceipt’ exists in both ‘Security, Version=1.0.7807.33496, Culture=neutral, PublicKeyToken=null’ and ‘UnityEngine.Purchasing.SecurityCore, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’
Library\PackageCache\com.unity.purchasing@4.1.5\Runtime\SecurityStub\AppleValidator.cs(33,16): error CS0433: The type ‘AppleReceipt’ exists in both ‘Security, Version=1.0.7807.33496, Culture=neutral, PublicKeyToken=null’ and ‘UnityEngine.Purchasing.SecurityCore, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’
Library\PackageCache\com.unity.purchasing@4.1.5\Runtime\SecurityStub\AppleValidator.cs(53,16): error CS0433: The type ‘AppleReceipt’ exists in both ‘Security, Version=1.0.7807.33496, Culture=neutral, PublicKeyToken=null’ and ‘UnityEngine.Purchasing.SecurityCore, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’
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.

thanks

(I did look at this post but this is to build the game. I can’t run my scene in the editor, due to these errors
Can’t build my game after started using Unity 2023.1.13f1
)

@lz7cjc You need to upgrade to the latest IAP through Package Manager. You may need to upgrade your version of Unity in order to do so. First make a complete project backup. Then remove /Assets/PlugIns/UnityPurchasing completely and make sure your game compiles. You may need to comment out much of your purchasing code at this point. Then install the latest IAP via Package Manager.