IAP breaks my game

I learned from a previous project to install IAP from the outset and that has worked for me; but, having difficulty with my purchasing script, I updated IAP in the middle of my most recent project and came across an old problem: it disconnected all of my scripts and I have no idea how to get them back.

I’ve tried what worked in the past, which was deleting the IAP folder and meta file from the plugins folder but that hasn’t helped.

Does anyone know how I can recover all of my work or why this seems to always happen with IAP?

Thank you.

You’ll likely want to revert to a working backup, then install IAP from the Services window in Unity. You would not want to delete any files, the 1.23 IAP installer will delete any old versions. I would recommend to use Unity 2018, there are a few issues with 2019 that we are still looking into, but it is possible to get it working, I’m using it here.

Thank you. Unfortunately, I did not backup my project correctly. I copied and pasted a similarly named art folder. Do you know of any way to uninstall IAP or get my scripts reconnected?

Thanks again.

Please try this:

  1. Make a backup now
  2. Remove any of your scripts that reference IAP. Copy them outside of your project so you can add them back later
  3. Delete the Assets/Plugins/UnityPurchasing, Assets/Plugins/UnityChannel and Assets/Plugins/UDP folders
  4. Make sure your game compiles at this point. This is important. If it doesn’t compile, take a screenshot and post here.
  5. Once no compile errors, make another backup
  6. Import IAP from the Services window
  7. Make sure your game compiles
  8. Add your scripts back from (2)

I tried starting a new project in 2018, installed IAP and Ads, imported a package of my game assets but it won’t work because they were created with a newer version.

Ok, thank you, I will try this asap.

So, I did this and the scripts are not broken but I’m getting this error in my purchasing script:

"The name ‘StandardPurchasingModule’ does not exist in the current context "

The only thing I haven’t done is go into Plugins->UnityPurchasing and run the IAP UDP packages because that’s what broke it before and you instructed me to install it from the services window. Should I be running those packages? I wasn’t able to find a definitive, comprehensive tutorial for installing IAP successfully in 2019. The manual has this: https://docs.unity3d.com/Manual/UnityIAPSettingUp.html

Many thanks.

As mentioned, you probably don’t want to be using 2019, use Unity 2018 instead. If you need 2019, compare to a brand new project with IAP enabled, and see if it works. But yes the installer can fail and not complete the installation in some versions of 2019. You’ll want to double click on both the UDP and Purchasing packages that are placed in the Asset/Plugins folder to manually install them. Looks like you’ve already run the UDP, run the other one sitting next to it in the same location.

Okay, I’ll look into that and give it another shot. As I indicated before, when I try to run the project in 2018, I get errors that the assets are not compatible with the older version of Unity. Is there a workaround?

I meant please compare to a NEW project, and let’s just focus on IAP.

I exported my assets to a package, started a new Unity project, activated/imported IAP with my key, installed UDP/IAP, imported my package, tested my purchasing script and it all seemed to work except my assets have issues, particularly some elements aren’t rendering or are rendering in some unknown layer that I can’t figure out.

Does this help figure out what’s going on with IAP? I can redo my game in this way if you know what might be going on with the package import. I’ve been researching it for days but can’t figure it out. Basically, some sprites aren’t showing up as they were and my trajectory line, which is drawn out from a dot sprite, isn’t rendering.

I just thought of something and figured out it has to do with sorting layers not being created with the package import. I’ll look into that since it’s unrelated, unless you know a way to export/import that info off-hand.

Do you think there’s a solution to this IAP issue other than starting a new project?

Sorry I do not.