In App Purchase : Unavailable product?

Hey all,

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.

Any ideas?

Thanks!!

The error would not crash your game, something else is causing that. What changed yesterday? So you were able to make test purchases previously? Please provide your device logs, that error would occur during IAP initialization. Have you published to Google Play, and you are testing IAP under Closed testing, and you have created a second user account for testing, and added this account as a tester? https://docs.unity3d.com/Packages/com.unity.purchasing@4.4/manual/UnityIAPGoogleConfiguration.html and https://discussions.unity.com/t/699654

Thanks for the quick response.

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!

Sounds good. Please share a screenshot of your gems3 product on your Google dashboard, and also show where you are adding the product in your code.

Here is a screenshot of my products :

And part of the code to add the product :

8349876--1098690--upload_2022-8-9_14-19-1.png

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.

8349906–1098696–log.txt (288 KB)

Ok, after loading the game again I think I see more error info on why it may be crashing :

08-09 14:46:29.559 17757 17822 E Unity   : Using memoryadresses from more than 16GB of memory
08-09 14:46:29.559 17757 17822 E Unity   : (Filename:  Line: 120)
08-09 14:46:29.559 17757 17822 E Unity   :
08-09 14:46:29.699 17757 17822 E CRASH   :       #00 pc 0000000000651030  /data/app/~~NcOaqgyNIfjYh1_-EUkR1Q==/com.beatthegeek.btgtd-ei3ePndMwgVwEWiqfPGVHQ==/lib/arm64/libunity.so (BuildId: adeb43dc67d62c395765e322ddf952b281c82238)
08-09 14:46:29.699 17757 17822 E CRASH   :       #01 pc 0000000000650bd0  /data/app/~~NcOaqgyNIfjYh1_-EUkR1Q==/com.beatthegeek.btgtd-ei3ePndMwgVwEWiqfPGVHQ==/lib/arm64/libunity.so (BuildId: adeb43dc67d62c395765e322ddf952b281c82238)
08-09 14:46:29.699 17757 17822 E CRASH   :       #02 pc 0000000000650b20  /data/app/~~NcOaqgyNIfjYh1_-EUkR1Q==/com.beatthegeek.btgtd-ei3ePndMwgVwEWiqfPGVHQ==/lib/arm64/libunity.so (BuildId: adeb43dc67d62c395765e322ddf952b281c82238)
08-09 14:46:29.699 17757 17822 E CRASH   :       #03 pc 00000000001c93ec  /data/app/~~NcOaqgyNIfjYh1_-EUkR1Q==/com.beatthegeek.btgtd-ei3ePndMwgVwEWiqfPGVHQ==/lib/arm64/libunity.so (BuildId: adeb43dc67d62c395765e322ddf952b281c82238)
08-09 14:46:29.699 17757 17822 E CRASH   :       #04 pc 00000000008b8a34  /data/app/~~NcOaqgyNIfjYh1_-EUkR1Q==/com.beatthegeek.btgtd-ei3ePndMwgVwEWiqfPGVHQ==/lib/arm64/libunity.so (BuildId: adeb43dc67d62c395765e322ddf952b281c82238)
08-09 14:46:30.592  2135  2316 D WindowManager: requestTransientBars: swipeTarget=Window{1ad3133 u0 StatusBar}, controlTarget=Window{a879f8a u0 com.beatthegeek.btgtd/com.unity3d.player.UnityPlayerActivity}, canShowTransient=true, restorePositionTypes=0x0, from=com.android.server.wm.DisplayPolicy.access$100:226 com.android.server.wm.DisplayPolicy$1.onSwipeFromTop:569
08-09 14:46:36.569  2135  2316 D WindowManager: rotationForOrientation, orientationSource=ActivityRecord{36bcfb8 u0 com.beatthegeek.btgtd/com.unity3d.player.UnityPlayerActivity t3711}
08-09 14:46:37.661  2135  2316 D WindowManager: rotationForOrientation, orientationSource=ActivityRecord{36bcfb8 u0 com.beatthegeek.btgtd/com.unity3d.player.UnityPlayerActivity t3711}
08-09 14:46:39.552  2135  2732 D InputDispatcher: a879f8a com.beatthegeek.btgtd/com.unity3d.player.UnityPlayerActivity (server) is not responding. Waited 10003ms for MotionEvent
08-09 14:46:39.571  2135  2732 W InputDispatcher: Window a879f8a com.beatthegeek.btgtd/com.unity3d.player.UnityPlayerActivity (server) is unresponsive: a879f8a com.beatthegeek.btgtd/com.unity3d.player.UnityPlayerActivity (server) is not responding. Waited 10003ms for MotionEvent
08-09 14:46:39.571  2135  2732 W InputDispatcher: Canceling events for a879f8a com.beatthegeek.btgtd/com.unity3d.player.UnityPlayerActivity (server) because it is unresponsive
08-09 14:46:39.572  2135  2732 I WindowManager: ANR in com.beatthegeek.btgtd/com.unity3d.player.UnityPlayerActivity. Reason:a879f8a com.beatthegeek.btgtd/com.unity3d.player.UnityPlayerActivity (server) is not responding. Waited 10003ms for MotionEvent
08-09 14:46:39.866  2135  2316 D WindowManager: rotationForOrientation, orientationSource=ActivityRecord{36bcfb8 u0 com.beatthegeek.btgtd/com.unity3d.player.UnityPlayerActivity t3711}

Am I somehow using too much memory? This never seemed to be an issue before…

After reading this : Android 11 ARM64 native heap allocator issues

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!

Take care!

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)

1 Like

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

1 Like

@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.”