Error, authentication required

I found similar questions to this and followed the advice without much success.

I am writing my first app and I am adding inapp purchases. When "mHelper.launchPurchaseFlow" is called an application, the message box "Error, authentication required. You need to log in to your Google account is displayed.

I came in. I tried to delete the account and restore it. I tried to create a new account and use it instead. I tried the app on two different tablets with the same result.

Here is an example of my code. The purchase item is configured in my google developer console. My code only calls "buy_two_stars" after it mHelper.startSetup()

returns success.

The value in the variable purchaseprogress

indicates that it never goes through the function buy_two_stars()

:

public void buy_two_stars()
{
    mHelper.launchPurchaseFlow(this,"item_stars",1001,purchasedit,"");
    PurchaseProgress=0;
}



IabHelper.OnIabPurchaseFinishedListener purchasedit=new IabHelper.OnIabPurchaseFinishedListener() {

@Override
public void onIabPurchaseFinished(IabResult result, Purchase info) 
{
    if(result.isFailure())
    {
        PurchaseProgress=-1;
    }
    else if(info.getSku().equals("item_stars") )
    {
        purchaseditem=info;
        mHelper.consumeAsync(info,consumerfunc);
        PurchaseProgress=1;
    }   
}
};
IabHelper.OnConsumeFinishedListener consumerfunc=new IabHelper.OnConsumeFinishedListener() 
{

    @Override
    public void onConsumeFinished(Purchase purchase, IabResult result) {
    if(result.isFailure())
    { 
        PurchaseProgress=-1;
    }
    else 
    {
        PurchaseProgress=0;
    }   
}
};

      

many thanks.

+3


source to share


3 answers


Have you published your app yet?

According to google documentation:

" Application projects are no longer supported

In the past, you could publish a "draft" version of your application for testing. This feature is no longer supported. Instead, there are two ways to test how an app is performing before release on the Google Play store:



  • You can publish your app for alpha channels or beta distribution channels. This makes the app available on the Google Play store, but only for testers that you whitelist.
  • In some cases, you can test the functionality of Google Play with an unpublished app. For example, you can test unpublished application invoicing support in your application using static responses, special reserved product IDs that always return a specific result (such as "bought" or "returned").

Source: http://developer.android.com/google/play/billing/billing_testing.html#draft_apps

So, to check with real product IDs, I'm afraid you need to publish your app.

+2


source


I had the same problem and didn't see anything outstanding in your code. I bet you did exactly what I did. Uploaded the APK to alpha, beta or production and then tried to get it to work. You should be in the upper right corner. Then wait about 12 hours for it to become fully functional.



+1


source


Meanwhile, there is a new tab in the Play Console called " License Testing "

... it looks something like this:

enter image description here

0


source







All Articles