I implemented In App Purchases using Unity’s IAP Library. Everything has been going great and for the last month or so everything appeared to be working during my testing (only been testing with Android so far).
I have tested it both within Unity’s IDE and on my personal mobile device and all seemed good…
Well, until yesterday. When I load my game on my mobile device, I get this error :
Unavailable product gems3
If I log into my google developer console and look at my IAP products, I do have a “gems3” product. I also have not made any changes here in months.
I have added Debug Logs everywhere in my code and I can’t even find out where that error is coming from. I’m guessing it a unfinished purchase and Unity IAP is restoring the purchase when the game loads… but I can’t seem to track down the code that spits out the error.
I even tried uninstalling the game from my device and reinstalling. The error returns as soon as the game loads and crashes the game.
I don’t think I made any changes to the game recently that should have caused this issue. I was able to make test purchases before on my mobile device (I’d get the google email letting my know the purchase was successful, etc)
I do have the game publish process started (ie. I’ve added the game to google developer console, filled in some info and added IAP’s). The game is not live in the app store yet.
Currently I do not have testers, I am just using Unity to publish directly to my mobile device (by attaching a USB cable)
I’ll try getting the logs now and post the results here. Thanks!
However, at this point when I load my game this code doesn’t even run (game freezes before it’s run). I’ve added debug logs and they do not show up. I’m guessing some code runs as part of googles IAP that checks for pending purchases and that fails.
Still trying to get the logs which I will post shortly
Ok, I was able to get the logs which I have attached to the post.
I assume you only need to look at the very end of the log file. I do see the messages “Unavailable product gem2 -gem2” and “Unavailable product gems3 -gems3”. I do not have a “gem2” (with no “s”) so I am not sure how that got there… however, I do have a gems3 so that shouldn’t be throwing an error.
I also see this error : Unity Ads was not able to get current network type due to missing permission.
It’s looking like they want me to upgrade Unity versions. I am currently using 2019.4.11f1
I tried going to the latest version many months ago but it became a nightmare as so many thing needed to be upgraded to get it to work. I’ll try updating to 2019.4.40f1 and see if that helps
Got it, please keep me posted. As always, make a full project backup before upgrading. We also need to find out where gem2 is coming from. Make sure you are testing what you think you are testing. Make a change that you will be sure to recognize when you run the game.
Ya, no clue where gem2 is coming from. I haven’t changed anything to do with that code in quite some time. Is there a trick to remove the purchase of gem2 from that users account? I see no purchases in the google dev console (which I guess makes sense as it was a test purchase)… but it keeps trying to give it to me whenever my phone loads the game. (reinstalling doesn’t remove it)
Did you purchase gem2 at one point? It must be in your game. Please follow my previous suggestion of ensuring you are testing the right version of your game.
Ok, I think things are working now. I ended up upgrading to a slightly newer version of Unity (2019.4.40f1). When i did that I had a ton of errors in the console to fix. Most of them were complaining about duplicate libraries. Turns out I had enabled too many types of IAP… I installed the Unity IAP package… as well as the “In-App Purchasing” Service… (found within Unity in the Services menu). Apparently that one is for those that do not want to write any code to implement IAP. So I had both installed at the same time. My guess is the “gem2” was from when I was setting up the codeless version. I removed the codeless version and everything worked. The crashing stopped and the gem2 error went away.
Anyways, I really appreciate the help solving this!
Yes that would explain it! You still had that product listed in your IAP catalog, I had asked if you were using Codeless. And once you update IAP from Package Manager, you then delete everything under /Assets/Plugins/UnityPurchasing (the older Asset Store version)
Hello all,
I am also stuck at this exact same place. I am getting this error in Unity 2022.3.3f1 with In-App Purchasing 4.10.0. I am setting up IAP with google play store for the first time. I am using internal testing and uploaded the build. I am using code sample found in IAP. I am using developer account with an organization. I tried to use IAP catalog but, I removed it. I don’t know if it is relevant, but I also have google play sign in and facebook sign in. I am at my wit’s end right now. I have
I am having this issue as well. For me, they are subscription products. For some reason, my ‘removeadspermonth’ id is appearing as ‘removeadspermonth-removeadspermonth’ when the game is trying to initialize the products.
Im having the same issue as you attishno1. Not happening all the time, but i can see on GameAnalytics that a product like coins_1 sometimes appears as coins_1-coins_1
@simplebitstudios I had the same issue and for me it was a wrong package name.
This thread and Voxel-Busters content really helped here.
As he mentioned “Being said that, we found product unavailability usually happens for some very common reason - Not completing or accepting the Tax agreements. Have a look here for a testing guide. Make sure you cross check the steps and if it works on TestFlight, it should work everywhere.”