Testing in-app billing: “The publisher cannot purchase this item”

后端 未结 13 1358
我寻月下人不归
我寻月下人不归 2021-01-31 01:24

My app seems ready to get a \'real life\' test for an in-app purchase procedure on my device. However, I receive an \"The publisher cannot purchase this item\" error message in

13条回答
  •  隐瞒了意图╮
    2021-01-31 02:07

    Here's an attempt to put all the requirements into one answer. This is the simplest process that worked for me:

    1. Set up a new Gmail account, or use an existing Gmail account that is not your developer account.
    2. List the email address of the test account in the Google Play Developer Console in Settings > Account Details > License Testing.
    3. On your device, go to Settings > Accounts, select your developer account, tap the three-dots menu, then select Remove to remove the account from the device. You can add it again later.
    4. Build a signed, release variant of your app.
    5. Upload the app as an alpha in the Play Store, publish it, and wait several hours for it to become active. Or setup an internal test channel to get the update faster.
    6. If your device already has a debug version of the app installed, you will have to delete that. Or use this technique to run the debug and release versions in parallel (but you will still need to delete the debug version the first time).
    7. Download the release version onto your device. Apparently you can do this from the Play Store by navigating directly to the app URL, but whenever I tried this I received an "item not found" message. I uploaded the app to my own server and then downloaded it to the device from there.
    8. Download the release version onto your device. Or use this technique to sign the release build in Android Studio from your keystore, then deploy the app onto your device from Android Studio.
    9. Run the release version on your device. If the alpha in the Play Store is not yet active, you'll see an error that the app version isn't configured for in-app billing. If the alpha is ready, you will be able to proceed through the test process.
    10. When you get to the payment screen, you will have to enter real payment information, even though you will not be charged for your purchases. I opted to use an existing PayPal account rather than add my credit card info to my Google test account.

提交回复
热议问题