By Gatekeeper


2012-06-17 03:20:22 8 Comments

When I try to run my application with in-app billing I am getting the error: "This version of the application is not configured for billing through Google Play. Check the help center for more information".

I have the billing permission already in the Manifest file and I have a signed .apk uploaded as a draft onto Google Play and I have also installed that same signed apk onto my phone.

Any help on how to solve this issue?

18 comments

@Luten 2014-03-18 02:24:02

This error may be caused by several reasons.

Here is the list of requirements for the Google IAB testing.

Prerequisites:

  1. AndroidManifest must include "com.android.vending.BILLING" permission.
  2. APK is built in release mode.
  3. APK is signed with the release certificate(s). (Important: with "App Signing by Google Play" it only works if you download directly from GooglePlayStore!)
  4. APK is uploaded to alpha/beta distribution channel (previously - as a draft) to the developer console at least once. (takes some time ~2h-24h).
  5. IAB products are published and their status set to active.
  6. Test account(s) is added in developer console.

Testing requirements:

  1. Test APK has the same versionCode as the one uploaded to developer console.
  2. Test APK is signed with the same certificate(s) as the one uploaded to dev.console.
  3. Test account (not developer) - is the main account on the device. (Main account might be not necessary - according to @MinosL comment)
  4. Test account is opted-in as a tester and it's linked to a valid payment method. (@Kyone)

P.S: Debugging with release certificate: https://stackoverflow.com/a/15754187/1321401 (Thnx @dipp for the link)

P.P.S: Wanted to make this list for a long time already.

Thnx @zlgdev, @Kyone, @MinosL for updates

@georgiecasey 2014-04-18 18:05:23

that's a nice little round up of the many conditions needed for IAP. +1

@SARose 2015-01-26 06:04:49

This should be the accepted answer for this question!

@enobayram 2015-04-24 07:20:31

The best answer here, it's a shame that Google's own docs don't have such a round up. Working with Google Play Store has been frustrating due to poor and scattered documentation.

@papadi 2015-04-28 13:11:31

Being an absolute newbie in Android development, I don't understand No 3. What do you mean 'Release certificate'?

@Luten 2015-04-29 06:54:44

@papadi then you should read this carefully (there are some pitfalls): developer.android.com/tools/publishing/app-signing.html

@Olof Hedman 2015-11-12 13:53:04

How wonderful it would be if google could provide such nice and condensed lists instead of hiding the information in massive blocks of texts spread out over half a dozen pages.... Have a +1

@Kyone 2015-11-17 00:21:34

Don't forget to make sure the account you're using to test IAB is opted-in as a tester using the "opt-in URL" generated once you've uploaded a build; AND that it's linked to a valid payment method.

@Tallboy 2016-03-16 18:17:16

Why do they make this stuff so confusing, it's absolutely infuriating when you have to go to SO to get this information.

@Siddharth 2016-07-16 10:29:38

After adding BILLING permission to main manifest file, this error dialog box removed from my build. But I don't know why before I can able to add In App Products into play store account!!!

@Ellis 2016-08-25 21:03:33

The key piece for me was what @Kyone said - the tester needs to have opted in!

@vuhung3990 2017-03-02 07:48:38

on android studio: build -> generate signed APK, then install to device

@Juan 2017-04-03 17:17:33

Shouldn't it be easier to just test IAP? Or to test things in general..

@Phil Seeman 2017-06-18 19:30:52

The keys for me: first, what @Kyone said about the tester needing to opt in and to have a valid payment method set up; second, that the APK is signed with the release certificate - by default a debug build uses a debug keystore, and in VS you need to manually edit the .csproj file to tell it to use your release keystore instead, as documented here in the "Permanently Use a Different Keystore" section.

@guness 2017-11-17 08:50:20

also worth noting; test account should not be linked to developer account (should not have access to upload APK)

@guness 2017-11-17 10:53:39

also worth noting; if "App signing certificate" is enabled, then we cannot use our local APK to test with real purchases since we cannot sign with signing certificate. (took me like 3 hours to find out)

@Matteo 2018-05-14 23:31:30

This is funny, I have one app where I can do how many purchases I want in debug mode, with different version code from the one uploaded.How is it possible? I also think I'm not in the tester list

@Ali Akram 2018-08-27 17:25:55

Wait for 24hrs after uploading it on google playstore and to test on debug apk right away use this SKU 'android.test.purchased'

@mehmet6parmak 2018-12-16 09:42:13

was the 3rd testing item on my case, thanks a lot.

@MinosL 2019-02-07 10:31:42

I've been successfully testing with 1) a signed debug app that is 2) not the main account on the device, so the process for Google IAB testing seems to be not as strict as noted above.

@Luten 2019-06-04 05:22:15

@MinosL 1) Signed debug app is ok and it's mentioned in the answer. 2) "Main account is not nessesary" - thanks, longilong added it to the list

@Sagar Pithiya 2018-11-26 06:34:14

I have same problem in moto c2+ in my case it is device problem once i restart then it will rune perfect...

@Pablo Cegarra 2018-07-11 12:21:11

In the developer console:

Settings -> Account details -> License Testing -> Gmail accounts with testing access

and type here your accounts

@Ali Akram 2018-06-04 09:46:47

SOLUTION

Just hold on a while after uploading your app on play store because google takes some time to update app versions.It will work !

@Law Gimenez 2018-05-11 00:36:48

If you're here from 2018, you need to download the APK directly from Play Store and install the "derived" APK. Maybe it is because of Google's Play Store has a feature "App Signing by Google Play".

@Manish Gupta 2018-05-18 11:04:03

Thanks Law. You have saved my time. I made some changes in code I was so worried why my code was not working. pheww..

@Law Gimenez 2018-05-29 13:26:57

Glad to help out @ManishGupta

@Zhen Liu 2018-08-22 03:10:24

Which APK? I am using AIDL do i still need to do that?

@Law Gimenez 2018-12-11 01:50:49

@ZhenLiu I guess not needed

@JDune 2019-07-16 14:46:20

In addition, the app cannot be already installed on the device by a different means (ie. Android Studio). Installation/update from the Play Store will work, but the IAP will not - you'll get the OPs error.

@Anoop M 2018-03-28 06:42:24

Recently google has implemented a change on their systems, and since you have uploaded at least one APK to your console, you can test your in-app requests with your app with any version code / number.

Cross reference LINK

Configure gradle to sign your debug build for debugging.

android {
    ...
    defaultConfig { ... }
    signingConfigs {
        release {
            storeFile file("my-release-key.jks")
            storePassword "password"
            keyAlias "my-alias"
            keyPassword "password"
        }
    }
    buildTypes {
        debug {
            signingConfig signingConfigs.release
            ...
        }
    }
}

@JDenais 2018-01-22 15:58:02

Another reason not mentioned here is that you need to be testing on a real device. With the emulator becoming really good, it's an easy mistake to make.

@Søren 2017-03-31 06:50:20

Had the same problem, and it was not solved before i read the post from DZDomi. It suddenly occurred to be that there is a setting in the Google Developer Console that you need to enable. In the "In app purchases" section, there's a line for your product and to the far right there's a status for it. It should be ACTIVE!

@DZDomi 2016-08-22 13:54:36

The problem also occurs, when you have added an in-app purchase after you uploaded the apk, but you have not published the application in the play store (alpha, beta and production).

Which basically means, that you have to add the In-App purchase AFTER you have published the apk in the Play store (alpha, beta and production). Otherwise you wont be able to purchase or query for the In-App purchase.

@Epsilon3 2014-07-23 00:20:36

Contrary to many answers and comments on SO and other sites, you do NOT have to perform preliminary tests with an alpha/beta version of your product that has been downloaded from Google Play onto your test device (the alpha/beta publication process often eats up half a day). Neither do you have to load and re-load a signed release apk from your developer studio to your test device.

You CAN debug preliminary Google Play in app billing services using the debug app as loaded from your developer studio directly to your test device via ADB. If you are experiencing errors that prevent this, likely you have done something wrong in your code. Pay especially close attention to the CASE of your SKU's (product ids) and their format (for example, if you load your APK as com.mydomain.my_product_id, be sure your try to purchase it this way - providing the same case and domain). Also, pay especially close attention to your itemType - this should be either "inapp" or "subs" for managed/unmanaged in app purchases or subscriptions, respectively.

As suggested by Chirag Patel, provided you have your billing code properly established, perform all testing using the android.test.purchased Sku (product ID) during your preliminary tests. Check for this ID throughout your billing operations to pass it through signature, token and payload checks, since this data is not provided by the Google test system. Additionally, give one of your test products this ID to test its purchase, unlock/load and presentation all the way through your schema. To CLEAR the purchase, simply consume it, passing the same Sku AND a token string formatted this way - no other fields are relevant :

    "inapp:"+appContext.getAppContext().getPackageName()+":android.test.purchased";

Once you have completed this phase of testing, move to semi-live testing with your alpha/beta product. Create a Google group (essentially a mailing list), add your test users emails to it, and add/invite this group to test your device in this phase (performed at the "APK" portion of your app's Google developer listing). Purchases will be simulated but not actually charged - however to clear and re-test the purchases, Google indicates that you must refund them from your Google wallet. THIS is the only phase of testing that requires the time-consuming process of using alpha/beta loads and test users.

@Shree Harsha S 2016-01-02 15:48:24

Let me just add what happened with me, may help some one.

It was mainly due to signing.

Since I have added the signing details in the Project structure, I was thinking that every time when I run, expected signed apk is getting installed. But build type 'debug' was selected.

Below fix solved the problem for me.

  • Generated signed apk of build type 'release'.
  • Manually installed the apk.

@Pablo 2014-12-31 12:21:45

If you want to debug IAB what do you have to do is:

  1. Submit to google play a version of your app with the IAB permission on the manifest:

  2. Add a product to your app on google play: Administering In-app Billing

  3. Set a custom debug keystore signed: Configure Eclipse to use signed keystore

@Gal Rom 2014-09-28 10:04:55

my problem was that i tried to check it with the debug.keystore , i mean running it through eclipse.I exported it with the keystore with which i published in alpha mode(it must be published before you can test it).installed it in my phone and than i could test it normally.

@Chirag Patel 2013-02-06 12:08:46

You need to sign your APK with your live certificate. Then install that onto your test device. You can then test InAppBilling. If you are testing your application by direct run via eclipse to device(In debug mode) then you will get this error.

If you are using android.test.purchased as the SKU, it will work all the way, but you won't have the developerPayload in your final response.

If you are using your own draft in app item you can test all the way but you will be charged and so will have to refund it yourself afterwards.

You cannot buy items with the same gmail account that you use for the google play development console.

@cdavidyoung 2013-02-19 00:41:22

+1 Running from debugger uses debug certificate. After exporting the app and creating a new public key (and installing it in the developer console), just email yourself the apk and install it from your gmail inbox.

@Rocologo 2014-05-10 07:07:03

If I want to try "android.test.purchased" am I then going to change the SKU in both my code and in the developer console?

@Victor R. Oliveira 2016-12-31 00:41:01

you're a ***** genius man! s2

@Amalka 2013-11-25 07:49:13

This will happen if you use a different version of the apk than the one in the google play.

@goRGon 2013-11-06 22:37:24

In my case I saw the same message due to the different signatures of the installed apk and an uploaded to the market apk.

@Gatekeeper 2012-06-18 01:19:24

Ahh found the solution after trying for a couple of hours.

  1. Google takes a while to process applications and update them to their servers, for me it takes about half a day. So after saving the apk as a draft on Google Play, you must wait a few hours before the in-app products will respond normally and allow for regular purchases.
  2. Export and sign APK. Unsigned APK trying to make purchases will get error.

@Simon 2012-08-06 20:16:17

Wow, is this serious? Just ran into the same problem. Did everything Google asked me to do in order to test in-app billing, but still getting the same evasive error message. I guess I'll have to wait and see. But does Google really expect us developers to wait hours each time we need to update our app in order to implement in-app billing? It seems quite inappropriate to me, to say the least.

@Alfie Hanssen 2013-08-01 19:37:50

Can you test while connected to Android Studio / running while connected to the debugger? Or do you need to install the release apk via USB?

@wired00 2013-08-28 04:23:44

Is there an easier way to test the purchase process other than, Android Tools > Export signed project... etc, then manually copy APK across to device, Test, .... repeat? I must be missing something?

@TacB0sS 2013-09-12 05:28:56

Seriously, I cannot use the application with debug certificate and test In-App Billing?

@Andrew Arnott 2014-01-04 19:27:17

Even with the signed apk installed, I'm still getting this error.

@MikkoP 2014-03-14 16:41:21

It seems like the testing device has to have the exact same APK installed that is in Google Play. It doesn't need to be in production, beta works too. But this makes developing very hard. To test it, you have to upload the APK to Google Play, and it takes them hours to refresh. So, if I just want to add one logger call, I need to wait hours for it to work. Or am I missing something?

@cottonBallPaws 2014-05-14 04:23:05

Note that you CAN use debug builds, straight from your IDE as you are working. You just need to change the debug keystore to one that matches your release store. See this post for more information on how: stackoverflow.com/questions/10886814/…

@David 2014-09-17 14:36:52

I export a signed APK, and run it manually on my device, the problem solved. 10x!

@craig lerr 2015-01-21 16:55:19

@gatekeeper will it also take half day if I do some changes in IAP and test it in my Android phone without updating to Google play?

@sammysounder 2016-03-24 21:40:04

I downvoted. No problem with this answer but the one below is more helpful as it covers more potential problems.

@Vidar Vestnes 2016-04-08 18:56:51

@gatekeeper Do you happen to know which countries that I manually need to report and pay VAT tax for on In-app billing with Google? I have read that Japan needs manually reporting. Anyone else? I would be happy If you could read/answer my Q at stackoverflow.com/questions/36506835/…

@Julian K 2019-02-18 19:29:54

For Android Studio users (not eclipse), follow steps here: stackoverflow.com/questions/16965058/…

@sandalone 2012-07-09 12:31:11

The same will happen if your published version is not the same as the version you're testing on your phone.

For example, uploaded version is android:versionCode="1", and the version you're testing on your phone is android:versionCode="2"

@Youddh 2012-12-17 07:35:18

can u tell please me what if uploaded version is android:versionCode="1" and phone is android:versionCode="2" dose it ok or i have to change my apk google play ?.

@Romain 2013-02-12 13:30:46

What you need to do is to bump down the local version to "1" so it matches the current live version, as least temporarily for testing.

@Matt 2013-05-20 12:44:14

Looks like there are 2 common fixes to this error depending on your situation. In my case it was this one.

@Justin Smith 2013-11-05 14:10:37

This one also fixed my problem.

@Yasitha Chinthaka 2014-02-18 16:21:16

Agree depends on situation there are two fixes, This one solved my issue. thanks

@Anna Billstrom 2014-04-12 01:22:18

Thank you, this was the issue. Was debugging fine with release signed apk on my attached device. Then, changed the versioncode and it started getting the 1005 error. whew!

@JacksOnF1re 2015-03-20 17:09:36

@Anna be aware that -1005 is also USER_CANCELLED if you use iabHelper

@Bruno Lemos 2017-06-08 22:46:21

This does not happen anymore apparently github.com/googlesamples/android-play-billing/issues/…

Related Questions

Sponsored Content

11 Answered Questions

[SOLVED] The apk must be signed with the same certificates as the previous version

2 Answered Questions

[SOLVED] Google Play App Signing and In App Billing Testing

1 Answered Questions

0 Answered Questions

10 Answered Questions

1 Answered Questions

2 Answered Questions

Sponsored Content