1
votes

I wish to test my application with In-App Billing.

The requirements for adding purchases (subscriptions) to an app and making it available is as follows:

  • Add Billing Permission with <uses-permission android:name="com.android.vending.BILLING" />

  • Have some Subscription or Purchasable product defined in the Play Console in the Store Presence > In-App Products)

  • Having implemented the BillingClient as explained in detail here implented as a step-wise tutorial

  • Finally, uploading your app to the Playstore. For testing, you can upload the app to the Closed Track Testing environment where you can defined testers as explained here and play store testing here

My Problem:

On the In-App Billing Test guide - Test Complete Workflow section, a blue Note box reads:

Note: After your initial app upload, license testers can make purchases from development versions of your app without needing to upload to the Play Console. This allows you to use debug signed builds and make changes without having to upload a new version each time.

To my understanding, this means I can create a signed APK with debugging enabled and upload it to the Closed Test track for testing.

When attempting this, I get the following error:

Upload Error You uploaded a debuggable APK or Android App Bundle. For security reasons you need to disable debugging before it can be published in Google Play.

Am I missing something?

Note: The documentation makes mention of the Android Developer Public Key although I have not found an official in-app purchase tutorial that requires it. Is it required for purchase to proceed?

2

2 Answers

2
votes

To my understanding, this means I can create a signed APK with debugging enabled and upload it to the Closed Test track for testing

Actually no, any build you upload to an alpha, beta or real release must be non debuggable.

So after you have published your initial build that supports billing (to a closed track), you can just sideload a new build from Android Studio for example to your device directly. This build must be signed (using the same signature of the test release you made), but it can be debuggable. I think it also needs to have the same version code. This will allow you to debug your app and fix any issue related to billing you might be encountering.

So to sum up, this is how you can test in-app billing:

  • Make initial release to a closed track (alpha or beta). This build must be signed and non debuggable.
  • Once the build above is available (usually takes a couple of hours after it's been published), you can sideload debuggable builds that are signed (with the same signature as the build above) and have the same version code as the build above.
0
votes

Your understanding might be wrong. Check Again.

Note: After your initial app upload, license testers can make purchases from development versions of your app without needing to upload to the Play Console. This allows you to use debug signed builds and make changes without having to upload a new version each time.

Means you must required release build at time of upload, but after uploading, you can test with your debug Build with your changes.