Android app Billing NullPointerException på Android 8.0

stemmer
0

Jeg mottok klage fra Android 8.0 brukere som etter at de har gjort betaling, min app krasjer. De er ikke i stand til å motta det kjøpte elementet. Min i app fakturering bruker koden fra TrivialDrive (AIDL). Det fungerer bra på andre Android-versjoner. Dette er krasjrapportering:

java.lang.NullPointerException: 
  at .ConceptActivity$12.a (ConceptActivity.java:9)
  at .inappbilling.util.IabHelper$2$1.run (IabHelper.java:8)
  at android.os.Handler.handleCallback (Handler.java:790)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at android.os.Looper.loop (Looper.java:164)
  at android.app.ActivityThread.main (ActivityThread.java:6501)
  at java.lang.reflect.Method.invoke (Method.java)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:438)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:807)

Min IabHelperble kalt inn onCreate.

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);
                   }
                     }
            });

Dette er min kjøper ferdige Listener:

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();
            }

        }
    };

Og min Kriterier Lager Ferdig:

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();
            }
        }
    };
Publisert på 02/09/2018 klokken 05:26
kilden bruker
På andre språk...                            

Cookies help us deliver our services. By using our services, you agree to our use of cookies. Learn more