In-app billing android authentication required when trying to sign up for a product

This is my first time when it comes to in-app billing in android 1) I use API v3 2) I have an alpha version of my application to check and then

enter image description here

3) I created a subscription product

enter image description here

4) This is my product subscription code

mSubscribeButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { try { Bundle subscribeIntentBundle = mService.getBuyIntent(3, getPackageName(), "my_product_id", "subs", "bGoa+V7g/yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ"); PendingIntent pendingIntent = subscribeIntentBundle.getParcelable("BUY_INTENT"); if (subscribeIntentBundle.getInt("RESPONSE_CODE") == 0) { startIntentSenderForResult(pendingIntent.getIntentSender(), 4002, new Intent(), Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0)); } else { Toast.makeText(MainActivity.this, "Error Code: " + subscribeIntentBundle.getInt("RESPONSE_CODE"), Toast.LENGTH_SHORT).show(); } } catch (RemoteException e) { e.printStackTrace(); } catch (SendIntentException e) { e.printStackTrace(); } } }); 

5) I get the following error

enter image description here

  • I tried to use different devices and they all have the same error, I also logged in with my Google account and can open the Google Play Store and browse my applications.

  • I also tried clearing data from the Google Play Store from the application manager

Can anyone help?

+44
android google-play-services google-play in-app-billing in-app-purchase
Jan 13 '15 at 16:10
source share
7 answers

I have the same problem earlier. Go to the Google Developer Console and make sure your application is PUBLISHED for any version (alpha, beta or prod). Then buying the In app will work :)

+40
Jan 22 '15 at 2:31 on
source share

You have the same problem with a terrible message:

Authentication required. You need to log in to your Google account.

I had two problems:

  • I tried to buy the product in my code with the identifier "com.argonnetech.wordswriting.noads" , but the application product configured in the Google Play Developer Console (GPD) was simply called "noads"
  • After changing the product name in the application in the GPD console, I had to switch it to Active mode

It worked. The error message is misleading, such an error as "in the application does not exist, it will be better."

+19
Aug 27 '15 at 13:44
source share

Android developer testing for an in-app purchase account must be performed using these keys.

Base64EncodedPublicKey

// Testing base64EncodedPublicKey

 public static final String base64EncodedPublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCg" + "KCAQEAhNe2XQ70DceAwE6uyYJGK1dIBbZcPdlER/9EEzylr6RDU6tnGj0Tk7kceN03GKvRf/ucT+ERLL3O" + "aHR22PXRXLZ17NZ81x6oS2vGmLyXBnjrU/I+asl8cNuLGySaoCdXxPAV+A9g6OG13dk+KY9i0O1roGpFH" + "fsAFyKCgSqR0PMJZ1bS+wFFBYf3M4IxgBcxuuZKDmR+MztCgm5N4zc6w2CwFZn3mXeDoTg15mWDU3sZO" + "WeRwFeynhV+FCYdDp8DpAkLk1b5IiXYFQ53wxCh/GxiKqBB6uQMmAixFjAcZV1QWfcBABae9vxiV5" + "VAEJvOOnhPxnaT9HYadW0pQ/UbJwIDAQAB"; 

And the item so acquired

ITEM_PURCHASED

// Testing ITEM_PURCHASED

 public static final String ITEM_PURCHASED = "android.test.purchased"; 

And run this onCreate () code to initialize the IabHelper class for in-app purchase .

 IabHelper helper = new IabHelper(this, Constants.base64EncodedPublicKey); helper.startSetup(new IabHelper.OnIabSetupFinishedListener() { public void onIabSetupFinished(IabResult result) { if (!result.isSuccess()) { Log.d("#InAppStartSetup#", "In-app Billing setup failed: " + result); } else { Log.d("#InAppStartSetup#", "In-app Billing setup successful."); } } }); 

And finally bought time on this code descriptor,

 helper.launchPurchaseFlow(YOUR_ACTIVITY, Constants.ITEM_PURCHASED, YOUR_REQUEST_CODE, mPurchaseFinishedListener, ""); 

Thanks guys...

+6
Feb 14 '15 at 11:12
source share

The developer.android.com documentation seems outdated.

If you want to test the publication in your account without in your application, you need to create a google group and add an alpha list of testers. Take a look here: https://support.google.com/googleplay/android-developer/answer/3131213?hl=en

UPDATE

As of mid-2015, this is no longer required. You have several new testing options in the Google Play Developer Console.

+2
Apr 28 '15 at 18:13
source share

Most of the solutions above work, but for those who still have this problem, try the following:

  • In Android Studio, sign the application using the release key (this will create a signed app-release.apk file )
  • Then MAKE SURE you install it on your physical device using the adb / install path / your / app-release.apk ( NOT via Alpha / Beta )

screenshot


+2
Jan 22 '17 at 18:53 on
source share

In my case, versionCode , versionName and applicationId were not in sync with the current version of the application in the developer console. I changed them in the build.gradle file. They were different because I rewrote the application in the Android studio from an eclipse. After that, the billing worked in the application.

+1
Mar 28 '15 at 17:35
source share

Below works for me:

  • Download the draft application as alpha or beta with some version code.
  • Sign in to your device with an account that has an active subscription.
  • Install the signed application on this device with the same version as the alpha / beta version.
+1
Nov 20 '16 at 18:48
source share



All Articles