9

i'm trying to enable in app billing. I've created In-app-products on my google play console and got my License key. When i try to purchase product. I get this image error.

enter image description here

Here is the code i use to create BillingProcessor.

bp = new BillingProcessor(this, LICENSE_KEY, MERCHANT_ID, new BillingProcessor.IBillingHandler() {
        @Override
        public void onProductPurchased(@NonNull String productId, @Nullable TransactionDetails details) {
            showToast("onProductPurchased: " + productId);
            updateTextViews();
        }
        @Override
        public void onBillingError(int errorCode, @Nullable Throwable error) {
            showToast("onBillingError: " + Integer.toString(errorCode));
        }
        @Override
        public void onBillingInitialized() {
            showToast("onBillingInitialized");
            readyToPurchase = true;
            updateTextViews();
        }
        @Override
        public void onPurchaseHistoryRestored() {
            showToast("onPurchaseHistoryRestored");
            for(String sku : bp.listOwnedProducts())
                Log.d(LOG_TAG, "Owned Managed Product: " + sku);
            for(String sku : bp.listOwnedSubscriptions())
                Log.d(LOG_TAG, "Owned Subscription: " + sku);
            updateTextViews();
        }
    });

LICENSE_KEY is my license key from google play console, and MERCHANT_ID is null.

This is how i buy items.

bp.purchase(this,PRODUCT_ID);

Where PRODUCT_ID is product1 which i use in my google play console, here is the example of my in-app products.

enter image description here

Any idea how to fix this ? There is only one stackoverflow question with DF-AA-20 problem which has no answers. And there is no information on the internet about it. I have tried to use emulator and my android phone.

Miljan Rakita
  • 1,433
  • 4
  • 23
  • 44
  • have you tried clearing cache of Google Play Store? If you are using multiple email Id's try changing them in your phone. Capture and upload logs in your question – Amod Gokhale Dec 13 '17 at 01:45
  • @AmodGokhale I have tried, it didn't help. I only use one email. But when i tried to purchase something from lets say Subway surf it works perfectly for their in app purchase. I have tried to connect my license key with google sample project and it didn't work. I guess i did something wrong in my google play console, what could be ? If you don't have enough details from this product list what else can i provide you which could help me to solve my problem ? Thanks in advance ! – Miljan Rakita Dec 13 '17 at 02:53
  • Can you please upload logs in your question when transaction fails? – Amod Gokhale Dec 13 '17 at 04:43
  • did you get solution for this? – Kriti Dec 15 '17 at 06:52
  • @Kriti app wasnt publish – Miljan Rakita Apr 29 '18 at 01:22

5 Answers5

14

DF-AA-20 means your app is not published in any way on the Play store. This is normally because either:

  • you haven't published it yet. To test In-App Billing it must be pushed to at least alpha. See the testing IAB docs for more information
  • your app or developer account has been banned/suspended for abuse
  • you make some change to your package name/applicationId, so that in your apk it doesn't match the one on Play. Developers sometimes do this with build flavors
Shashank Agrawal
  • 25,161
  • 11
  • 89
  • 121
Nick Fortescue
  • 13,530
  • 1
  • 31
  • 37
  • I had to wait for them to publish my app first, it was a problem, now i get another error which is not related to this one. – Miljan Rakita Dec 16 '17 at 11:48
  • I actually happen to have this exact error code by doing an in app purchase from my app (that I literally downloaded from Google Play). And I have other apps in production working without problem, so my account is not banned. I wonder if there's not a "multiple users on the same device with two of them invited to alpha testing" issue here. – Karim Kouznetsov Feb 16 '18 at 10:04
  • As an addition to first reason "you haven't published it yet", it's possible that "applicationId" of your build is different from "applicationId" of published app. For example, you have several app flavors for different environments (prod, dev, uat) and for each flavor you have added different "applicationIdSuffix". – Stanislav Borzenko Jun 06 '18 at 10:49
7

Oh, I had this exception when I tested buys in my product with different sku.
Check your sku!
Sku must be not CAPS! Only [a-z][0-9]!

xoxol_89
  • 1,242
  • 11
  • 17
  • I checked my sku and it was ok... But as i found out on https://developer.android.com/google/play/billing/billing_testing.html site, i need first to publish my app at least for alpha testers before testing any in app billing, i think it was a problem, will see when they enable my alpha publish. – Miljan Rakita Dec 13 '17 at 11:38
  • @MiljanRakita i am facing same issue – chris Dec 18 '18 at 18:05
2

Just wait some time. I waited 25 minute and then product registered in google play

Dyno Cris
  • 1,823
  • 1
  • 11
  • 20
1

It might be handy to point out that you can also get this exact error code message when you simply haven't put your products as active yet in your Google Play Console. (Even in debug they need to be active.)

0

You must publish your app to playstore(not even alpha or beta publish will help).

Asim
  • 161
  • 1
  • 12