IabResult: Billing service unavailable on device. (response: 3:Billing Unavailable)

后端 未结 14 2579
隐瞒了意图╮
隐瞒了意图╮ 2020-12-15 04:37

I\'m trying to use In-App billing:

mIabHelper = new IabHelper(this, BILLING_KEY);
        mIabHelper.startSetup(new IabHelper.OnIabSetupFinishedListener() {
         


        
相关标签:
14条回答
  • 2020-12-15 05:18

    Well we can't help you without having much information.So instead I'll try to do a checklist for you in case you missed something:

    1. Are you testing on an emulator?Billing services should be tested on devices,BUT if you really have to test on the emulator,make sure the emulator has google play installed and set up.This is very important!

    2. Did you set the correct permission in the manifest? (com.android.vending.BILLING)

    3. If you are still testing the app,did you get a test app licence from the playstore, imported the level in your SDK ,set up your licence verification library? (you can follow along here: setting up

    4. On your activity onActivityResult did you correctly handle the activity result?As seen on the example from google you should do it this way:


    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data)
    {
      Log.i(TAG, "onActivityResult(" + requestCode + "," + resultCode + "," + data);
    
      // Pass on the activity result to the helper for handling
      if (!inappBillingHelper.handleActivityResult(requestCode, resultCode, data)) {
        super.onActivityResult(requestCode, resultCode, data);
      }
      else {
        Log.i(TAG, "onActivityResult handled by IABUtil.");
      }
    }
    

    Also having more information could be useful, like if you are testing on the emulator or device, the device name, the android version etc...

    0 讨论(0)
  • 2020-12-15 05:18

    I got that error when I installed the App BEFORE I registered everything and set Google Play store up. Once I set the Google Play Store account up, the error went away.

    0 讨论(0)
提交回复
热议问题