Is it possible to debug locally Google Play's in-app billing in Android Studio?

Viewed 25329

I am getting this error testing in-app subscription products locally.

authentication is required. you need to sign in to your google account

I was able to check the the inventory for the product but shouldn't I also be able to purchase it?

There are a number of posts about why this error might occur which I thought were addressed:

  • the product is released in the beta channel with in-app billing enabled
  • i am logged into Play Store with a test user licensed account on the device.

Is the only way to test actual purchases via the beta/alpha channels - not straight from android studio. This post suggests it possible (see screen shot)

http://developer.android.com/google/play/billing/billing_testing.html#billing-testing-test

5 Answers

Yes, just tried it and it works, thought it'd help someone save time.

Once you upload your app for closed testing, then you make change and uploading again is tedious task. After frustration from this repetition I found this under official documentation

Ordinarily, the Google Play Billing Library is blocked for apps that aren't signed and uploaded to Google Play. License testers can bypass this check, meaning you can sideload apps for testing, even for apps using debug builds with debug signatures without the need to upload to the new version of your app. Note that the package name must match that of the app that is configured for Google Play, and the Google account must be a license tester for the Google Play Console account.

Ergo, I had a list of email accounts added as testers and licensing, as a result of alpha testing. I ran the code with same release keystore and the billing works exactly as in alpha testing.

Just make sure to add your testing emails for licensing in new Play Console.

Play Console Screenshot

Depends on the use case of your In-App Billing but making sure to have set-up purchase items Play console in-app products

Related