Billing API v3 IabHelper NullPointerException

后端 未结 6 779
萌比男神i
萌比男神i 2020-12-12 16:14

edit 4/15: Catching nullpointer in IabHelper appears to have stopped this problem. I am no longer seeing the exceptions being thrown, I\'m going to accept

6条回答
  •  离开以前
    2020-12-12 16:41

    Slightly modify the beginning of the queryPurchases method to look like this:

    int queryPurchases(Inventory inv, String itemType) throws JSONException, RemoteException {
            // Query purchases
            //logDebug("Querying owned items, item type: " + itemType);
           //logDebug("Package name: " + mContext.getPackageName());
           boolean verificationFailed = false;
           String continueToken = null;
    
            do {
    //            logDebug("Calling getPurchases with continuation token: " + continueToken);
                if(mDisposed || mService==null) return IABHELPER_UNKNOWN_ERROR;
                Bundle ownedItems = mService.getPurchases(3, mContext.getPackageName(),
                        itemType, continueToken);
    

    Thanks to sebastie for pointing out the cause of this.

提交回复
热议问题