RajaReddy PolamReddy
RajaReddy PolamReddy

Reputation: 22493

What are the possibilities to get this error code 3 in InApp purchase?

I am using InApp V3 code for in-app purchases in my application , i am getting this error BILLING_RESPONSE_RESULT_BILLING_UNAVAILABLE and error value :3 when Google account is not available in device. I want to know is there any other possibilities to get this error, because when i get this error i need show a popup to the user with some data. If this is causing because of Google account not available on device i will show the dialog with related text. this is the code i am using

mHelper.startSetup(new IabHelper.OnIabSetupFinishedListener() {
    public void onIabSetupFinished(IabResult result) {              
        if (!result.isSuccess()) {
                // error here               
            return;
        }
    }
});

this is the error Error checking for billing v3 support. (response: 3:Billing Unavailable)

Upvotes: 31

Views: 42724

Answers (8)

Carlos Robles
Carlos Robles

Reputation: 10947

As we can see directly in the code of the setup of the IabHElper of the sample provided by Google, the error means:

"Billing service unavailable on device."

As you can read here that error means

Billing API version is not supported for the type requested

This is the In-app Billing Reference (IAB Version 3), so the error means that the IAB v3 is not installed on the device.

Actually this means that the user has a Google account, and probably also an in-app billing service, but it doesn't have the last version. This happens in old devices, and where the user never updates anything. It used to be devices where you can see the old Market app instead of the Play app.

So the error you have to show to the user, and the test that you have to perform is not if the device has a Google account, but if it has the Google Play services installed and properly updated.

If you look for the code in all the library SDK, and the helper classes provided by google, the only place where we can find that exactly in the function that you are calling: the startSetup of the IabHelper class

Intent serviceIntent = new Intent(
                "com.android.vending.billing.InAppBillingService.BIND");
        if (!mContext.getPackageManager().queryIntentServices(serviceIntent, 0)
                .isEmpty()) {
            // service available to handle that Intent
            mContext.bindService(serviceIntent, mServiceConn,
                    Context.BIND_AUTO_CREATE);
        } else {
            // no service available to handle that Intent
            mServiceConn=null;
            if (listener != null) {
                listener.onIabSetupFinished(new IabResult(
                        BILLING_RESPONSE_RESULT_BILLING_UNAVAILABLE,
                        "Billing service unavailable on device."));
            }
        }

This means that the app couldn't connect to the service in the device, since the package manager doesn't even know it. That's the only option that can trigger that error. And what does it mean that it couldn't connect to the service? It means one of these:

  • The device doesn't have the service installed.
  • It has an old version, since we know that the latest versions of play store, uses the IAB v3.

So, your error only can mean one of these, that for you means that you have to show a message to the user like "You don't have Google Play services installed, or you have to update it". And there are no other possibilities for getting that error.

But, if you want to make it easier for the users, you can say the they need to update the Google Play App to the last version. And that will make everything work like a charm.

Upvotes: 39

John T
John T

Reputation: 1082

If you're located in Tonga(as me) or any other country where you're unable to buy apps in Google Play you must use a VPN to test billing. Otherwise you will get this error.

Upvotes: 0

Babken Vardanyan
Babken Vardanyan

Reputation: 15040

Sign in to the Play Store with any account.

After signing in billing works even on Android Studio Emulator.

Upvotes: 10

Drilon Blakqori
Drilon Blakqori

Reputation: 2826

For anyone still facing this problem, in most cases iab isn't supported in your country like Williams said. You can use a VPN to make it work.

Upvotes: 2

User2364902
User2364902

Reputation: 431

Sometime if you haven't authenticated your device with Google account, may receive this error.

Upvotes: 1

pareshgoel
pareshgoel

Reputation: 991

This error is also received after the user removes their google account from the device.

Upvotes: 18

N Sharma
N Sharma

Reputation: 34497

Majorly possibility of your issue BILLING_RESPONSE_RESULT_BILLING_UNAVAILABLE is that In some countries still In App Purchase is not allowed like Serbia and many countries.

So Any user from the country where Google Play does not support In App Purchase then You will get BILLING_RESPONSE_RESULT_BILLING_UNAVAILABLE.

This would be less chance that user do not have updated Google Play Service installed on the phone so do not worry about this case.

Upvotes: 7

LOG_TAG
LOG_TAG

Reputation: 20569

Try this hacks

Remove the cache, data and updates for the play app, restarted the play app again it should work! or try with latest updates (if it is fixed)

FYI:

Just keep in mind:

  • IABv3 is built into Google Play services, so it requires an update to the Play Services apk.

  • V2 was built into the Play store client itself. The cache/EULA issue isn't specifically related to IAB, it's related to setting up Play Services (and hopefully is unnecessary for most users, the cache part anyway).

  • It's a bummer to be in this transition period where Play Services has to be updated before your app can take advantage of it, but I think most people would agree that it's better than waiting for an OS upgrade.'

See this ref: bug report, G+ post

Upvotes: 2

Related Questions