Inventory update failed. In-app billing

I configure and test billing in the application. I managed to buy android.test.purchased and it did what it should. But now I need to use it to continue testing. The problem is that I can’t get to the inventory.

When this is called, I get result.isFaliure () and I cannot get the inventory.

IabHelper.QueryInventoryFinishedListener _gotInventoryListener = new IabHelper.QueryInventoryFinishedListener() {

        @Override
        public void onQueryInventoryFinished(IabResult result, Inventory inventory) {

            if (_iabHelper == null) return;

            if (result.isFailure()) {
                Log.d(TAG, "Failed to query inventory: " + result);
                return;
            }

            Log.d(TAG, "Query inventory was successful.");

            Purchase premiumPurchase = inventory.getPurchase(SKU_PREMIUM);
            _isPremium = (premiumPurchase != null && verifyDeveloperPayload(premiumPurchase));
            Log.d(TAG, "User is " + (_isPremium ? "PREMIUM" : "NOT PREMIUM"));

            update();
        }
    };

It logs an error message

Failed to complete inventory request: IabResult: inventory update error (request for items in ownership). (Answer: -1003: purchase signature verification completed)

Android .test.purchased is still owned - it will not let me buy it again. My phone has a network connection, so it is not.

APK Google Play, , googles?

+4
2

... , . , :

If you have used the android.test.purchased then one way to get rid of the error is to do the following:-

 1. Edit Security.java and change the "return false" line in the
    verifyPurchase to "return true" - this is temporary, we'll be
    putting it back in a minute.
 2. In your QueryInventoryFinishedListener, after the "if
    (result.isFailure()) {...}" lines add the following to consume and
    get rid of your never ending android.test.purchased item:-

    if (inventory.hasPurchase(SKU_ANDROID_TEST_PURCHASE_GOOD)) {
    mHelper.consumeAsync(inventory.getPurchase(SKU_ANDROID_TEST_PURCHASE_GOOD),null);
    }
 3. Run your app so the consunmeAsync happens, this gets rid of the
    "android.test.purchased" item on the server.
 4. Remove the consumeAsync code (or comment it out). Back in the
    Security.java, change the "return true" back to "return false".
+10

:

" : , (base64EncodedPublicKey) . , ..."

base64EncodedPublicKey ...

.

+2

All Articles