As the title says, I'm getting this error when querying the inventory.
Failed to query inventory: IabResult: NullPointer while refreshing inventory. (response: -1008:Unknown error)
Someone knows for what this error is standing for?
As the title says, I'm getting this error when querying the inventory.
Failed to query inventory: IabResult: NullPointer while refreshing inventory. (response: -1008:Unknown error)
Someone knows for what this error is standing for?
If you call mHelper.launchPurchaseFlow(....)
with an SKU that is registered as a subscription in your Google Developer Console it will result in the error. It means either purchaseData or dataSignature is null.
Check IabHelper.java
if (purchaseData == null || dataSignature == null) {
logError("BUG: either purchaseData or dataSignature is null.");
logDebug("Extras: " + data.getExtras().toString());
result = new IabResult(IABHELPER_UNKNOWN_ERROR, "IAB returned null purchaseData or dataSignature");
if (mPurchaseListener != null) mPurchaseListener.onIabPurchaseFinished(result, null);
return true;
}
If you have a SKU that is registered as an subscription you have to use the method: mHelper.launchSubscriptionPurchaseFlow(....)
Also check this answer: Google Play In-App Purchase returns error code -1008: null puchaseData or dataSignature
I had this problem with my subscriptions because I haven't set the "itemType"
mHelper.launchPurchaseFlow(this,
SKU_INFINITE_GAS, IabHelper.ITEM_TYPE_SUBS,
RC_REQUEST, mPurchaseFinishedListener, payload);