In-app Billing - Google Play gives me the "You already own this item" message when queryPurchases() returns an empty list
Asked Answered
Q

2

16

I just made one test purchase for an item, and it failed because my Wi-fi died, but for some reason Google Play then gave me a message that the order was pending or something and that I should check it on some link (I forgot to write it down).

When I tried to make that same test purchase again, Google Play gave me that "You already own this item" error. Said purchase is NOT in my order history in the Google Play dashboard.

What's going on, and how do I resolve this?

EDIT: Clearing the Google Play Store cache, clearing the Google Services Framework cache, and reinstalling the app does not work.


EDIT 2:

I managed to resolve this issue by Force Stopping the Google Play Store app, clearing its data, then restarting it. Right now, I can only conclude that the purchases made when the Wi-fi is disconnected is in the Play Store app's Data, not Cache.

My question thus becomes: Is it the developer's responsibility to handle this particular case (when the solution is not within the app itself), and how does one handle it?

Quicksilver answered 24/10, 2018 at 2:52 Comment(1)
So did u find any proper solution?Swear
A
5

I had the exact same issue, where I got the error message that I already own this item, but the getPurchases call returned an empty list. What ended up working for me was getting the purchase history if this list is empty, and taking the purchase token for the last purchase of this specific product id and using that for the consume:

mService.getPurchaseHistory(version, packageName, "inapp", null, new Bundle());

Keep in mind the history contains the information of the last purchase of each of the product types from this user, so make sure to compare the product id's to the relevant one.

Autopilot answered 17/3, 2019 at 17:51 Comment(2)
What is mService and what is this method getPurchaseHistory()?Swear
@ShahoodulHassan I assume it is a wrapper around BillingClient#queryPurchaseHistoryAsync()Mcgaha
B
0

I encountered the same problem on some of my devices with a particular application that I already paid for and installed on another device. Clearing cache and force-stopping the Google Play store (and similar) applications on the phone did not help. What did help was to log-in on the Google Play store via Chrome on PC, and install the application from there, to any of my devices registered with Google Play. The Google Play on the phone side then showed the app "installing .. ". The app indeed was installed in minutes.

Bremer answered 8/2, 2021 at 20:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.