Unable to make an Android purchase in the app with the test account "Publisher cannot buy this item"

I am trying to test in-app purchases on Android.

I uploaded a privately signed apk to the Google Player Developer Console. This is currently a project in the Alpha Testing section.

When I try to buy an item, I get the following error:

The publisher cannot purchase this item. 

enter image description here

This bothers me because I am using a test account and not the account used to publish this application.

enter image description here

enter image description here

I suspect that this may be unsuccessful because I have a developer account on the phone, but this is my personal phone, so I do not want to delete the account from the phone (especially if I'm not sure if this will solve the problem).

Can I confirm that the publisher account must be completely deleted from the phone in order to test in-app purchases?

Thanks!

+6
source share
4 answers

First of all, you should pay attention to the fact that

Test Account:

Google Play does not allow you to use your developer account to directly purchase products that you created yourself in the application, you will need to create test credentials under the developer account profile.

for more information:

1) http://developer.android.com/training/in-app-billing/test-iab-app.html#PlayItemTest

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

Multiple accounts:

Note. For test purchases, the account for checking the license must be on Android users. If the device has more than one account, the purchase will be made with the account downloading the application. If none of the accounts has downloaded the application, the purchase is made using the first account. Users can confirm the account, buy by expanding the purchase dialog.

check this link:

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

Hope this solves your problem. Let me know if you would like more information.

+12
source

This method only works if you have at least one version of your application released for google play !

I do the following for testing when purchasing apps:

I am using a second phone with a separate google account. For payments, I use vouchers on Google Play. I create a signed version of apk, for example, for the app store, and download it to the device using adb install . Thus, I can make real purchases from the device and watch the debug output in the console. The advantage of this method is that I can create and replace apk in seconds without uploading it to the app store and without waiting for publication. I highly recommend registering one cash purchase through console output and saving it in a text file for later use. With this, you can easily perform a server-side validation check by sending a saved receipt over and over again until everything works. It’s not so painful to make purchases with real money for testing, 70% of your money is returned to you.

0
source

FWIW I can use the Android Studio and ADB bridge to test the assembly of debugging with in-app purchases on the same device with the second xxxxxxxxx.gmail.com to bypass the publisher who was blocked from buying their goods.

1) Do everything you need to install the application from the Play Store (I used the TrivialDrive sample in Android Studio) and received the error message "Publisher cannot buy this product."

2) On my desktop, I left my publisher gmail address and then created a new gmail account for testing.

3) On the Android device (my Lollipop) go to settings: accounts: google and add the Gmail acccount that you just created as the second account. He will offer you to add a payment method. You have to do it. Credit card, paypal, something. For the Play Store, you will need a valid second account that can buy things.

4) In the developer console, be sure to add the new gmail address as a tester in two places; APK of a specific application and in the settings of your account when testing a license.

5) In the Developer Console, in the App APK section, copy the tester selection URL and send it to your new gmail address to open it from email on your Android device.

6) Go to the Play Store app on Android. Click on the triple upper left upper panel. In the drop-down menu near the top there is an account that will be billed to buy things. Change it to the newly added gmail account.

7) On Android, log in to read the new gmail and find while waiting for your URL that you mailed. Click it and go through to install the application. Select the "Play Store" and not the browser to install when it gets there.

8) Now try to purchase the application. No longer the publisher can buy an error. The alpha test says that you will not actually be billed. You may need to wait a while for the changes made in the developer console to propagate through the system. So if the first attempt to purchase in the application does not work, wait half an hour and try again.

After that, you can restore the signed version of the release in Android Studio and install it through adb bridge. The in-app purchase continues to work. You can also create a debug version that will also work for IAP testing. You must add your repository information to the build.gradle file for the debug version to work.

  android { signingConfigs { release { storeFile file("MyAndroidKey.keystore") storePassword "mypassword" keyAlias "MyAndroidKey" keyPassword "mypassword" } debug { storeFile file("MyAndroidKey.keystore") storePassword "mypassword" keyAlias "MyAndroidKey" keyPassword "mypassword" } } 
0
source

In Google Play v4.9.13, on a phone running KitKat, you can swap between Google accounts from the Play store. In the application menu in the upper right corner is a drop-down list in which you can select the active account to use on Google Play. Please note that accounts must be added first to the device (in the device settings> Accounts).

I still need to test the IAP implementation for my application, but this seems to be a better option than factory reset for people who don’t support a separate “developer device”.

-1
source

All Articles