2

I have been developing a simple game for android and I have run into a number of issues while using in app billing. To perform IAB, I use the utility classes provided in the TrivialDriveExample here. I have copied and modified accordingly the code in the MainActivity class provided in this example to use IAB. I have also followed the documents on the android developer page describing how to set up IAB on the developer console.

However, when trying to test the purchase the product in the app using the following code, I get the error described in the title of the question.

helper.launchPurchaseFlow(game.getActivity(), sku, RC_REQUEST, getPurchaseListener(game));

(where helper is an instance of the IabHelper class provided in the google code link above and RC_REQUEST is a constant set to 10001 as shown in the MainActivity in the trivial drive example, and where sku is the sku of the product - as seen in the developer console). Here, getPurchaseListener returns an instance of an IabHelper.OnIabPurchaseFinishedListener (provided in the util package of the example code).

What I am certain of:

  • The sku is correct and exactly the same as the one provided on the developer console.
  • The APK that has been uploaded to the developer console as alpha is identical to the one installed on the device (and is signed with my developer key not the debug key).
  • My account and all used testing accounts are in both the google group registered for alpha testing and the list of accounts that receive the LICENSED response from the developer console.
  • Every object used in the code != null
  • I can test Google Play game services on my app (achievements & leaderboards).
  • It is to do with the app I am developing as IAB works for other apps (tested with Clash of Clans and Infectanator).

What I have tried:

  • Removing my developer google account from my device, leaving only a test account (+waiting overnight without my developer account installed on my device and then testing it in the morning with my test account).
  • Clearing all google play data and caches.
  • Restarting my device/reinstalling the application.

I also get another error when trying to use android's test purchases (using the sku 'android.test.purchase'). I get this:

Error while retrieving information from server [DF-DFERH-01]

As mention above, I have cleared google play data, removed my account and added it again, restarted my device and reinstalled the app. Again, this happens only on my app currently in development and not in any other apps with IAB.

EDIT Just to note, I have looked through other people's questions regarding this error and tried the solutions provided to no avail.

rodit
  • 1,746
  • 2
  • 19
  • 33

1 Answers1

1

The application with IAB integrated has to be Published for Play Store to enable the billing for it, it won't work so long as it's in Draft -- documentation seems to not be very clear about this.

So, make sure you actually publish the app (don't worry, if you've only got the alpha and/or beta version, it won't be listed in Play Store for simple mortals) and, as usual, allow some time for Play Store to absorb it.

Same answer here

Community
  • 1
  • 1
Ivan Bartsov
  • 19,664
  • 7
  • 61
  • 59
  • Thanks for the answer - I was unclear on what exactly 'Published' meant. I'll mark and upvote when I have tested it. – rodit Aug 23 '15 at 11:43
  • My app says Ready to Publish next to the icon but the publish button is greyed out. Do you know why this is? – rodit Aug 23 '15 at 12:02
  • Never mind - I relogged and it the button worked - now to test. – rodit Aug 23 '15 at 12:09