gpt4 book ai didi

android - IllegalStateException 由应用内支付引起的 checkNotDisposed

转载 作者:行者123 更新时间:2023-11-29 02:33:31 26 4
gpt4 key购买 nike

我为我的 Android 应用实现了应用内购买。应用内购买功能在我的设备和模拟器上都运行良好。但是,在将应用上传到 Google Play 后,我在 Google Play 开发者控制台上收到了这份崩溃报告,这是我的用户面临的一个问题。

java.lang.IllegalStateException: 

at inappbilling.util.IabHelper.checkNotDisposed (IabHelper.java)
or .flagStartAsync (IabHelper.java)

at inappbilling.util.IabHelper.checkSetupDone (IabHelper.java)
or .flagEndAsync (IabHelper.java)
or .getResponseCodeFromBundle (IabHelper.java)
or .getResponseCodeFromIntent (IabHelper.java)
or .getResponseDesc (IabHelper.java)
or .handleActivityResult (IabHelper.java)
or .launchPurchaseFlow (IabHelper.java)
or .queryInventory (IabHelper.java)
or .queryInventoryAsync (IabHelper.java)
or .queryPurchases (IabHelper.java)
or .querySkuDetails (IabHelper.java)
or .startSetup (IabHelper.java)

at inappbilling.util.IabHelper.checkSetupDone (IabHelper.java)
or .flagEndAsync (IabHelper.java)
or .getResponseCodeFromBundle (IabHelper.java)
or .getResponseCodeFromIntent (IabHelper.java)
or .getResponseDesc (IabHelper.java)
or .handleActivityResult (IabHelper.java)
or .launchPurchaseFlow (IabHelper.java)
or .queryInventory (IabHelper.java)
or .queryInventoryAsync (IabHelper.java)
or .queryPurchases (IabHelper.java)
or .querySkuDetails (IabHelper.java)
or .startSetup (IabHelper.java)

我的 IabHelperonCreate 中被调用。

String base64EncodedPublicKey = 
"<license key here>";

mHelper = new IabHelper(this, base64EncodedPublicKey);

mHelper.startSetup(new
IabHelper.OnIabSetupFinishedListener() {
public void onIabSetupFinished(IabResult result)
{
if (!result.isSuccess()) {
Log.d(TAG, "In-app Billing setup failed: " +
result);
} else {
Log.d(TAG, "In-app Billing is set up OK");
}
}
});

这是我的 Purchase Finished 监听器:

IabHelper.OnIabPurchaseFinishedListener mPurchaseFinishedListener
= new IabHelper.OnIabPurchaseFinishedListener() {
public void onIabPurchaseFinished(IabResult result,
Purchase purchase)
{
if (result.isFailure()) {
checkItem();
return;
}
else if (purchase.getSku().equals(ITEM_SKU)) {
removeAds();
}

}
};

我的查询库存完成了:

public void checkItem() {
mHelper.queryInventoryAsync(mReceivedInventoryListener);
}

IabHelper.QueryInventoryFinishedListener mReceivedInventoryListener
= new IabHelper.QueryInventoryFinishedListener() {
public void onQueryInventoryFinished(IabResult result,
Inventory inventory) {

if (mHelper == null) return;
Purchase purchase = inventory.getPurchase(ITEM_SKU);
if (purchase != null) {
removeAds();
}
}
};

最佳答案

你是你的谷歌播放面板中的定义项目吗?您是否在设备上安装了 google play?

关于android - IllegalStateException 由应用内支付引起的 checkNotDisposed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48353342/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com