简体   繁体   中英

Android In-App Billing error You need to sign into your google account

I am implementing in-app purchase using https://github.com/anjlab/android-inapp-billing-v3 . But while in app pop up open it shows "Error Authentication is required.You need to sign into your google account". I tested using different devices as same result.

Improtant ! I've spent a lot of time trying to find out why I'm getting error "Error Authentication is required.You need to sign into your google account". And after a lot of hours I found out - I was trying to access wrong item id from the console. In the developer console subscription item had id "premium" and I've tried to access "premium_version" item. Stupid mistake but error from google is absolutely not informative. Hope this helps

在我的情况下,发生的事情是正确的产品都在控制台上设置了,但是没有激活。

If anybody getting the above popup you can re-check through the following steps because unfortunately this google popup is not enough informative for a clue.

  1. Make sure you are using the product ID correctly(should be same as what you've put on developer console)
  2. Make sure you've activated the product on developer console before testing. It may take a while, so wait till it's ready.
  3. Make sure your the version of your app is published state on Beta,Alpha or Production
  4. Remember to add testing emails under testers list(Settings -> Testers List -> Create List). Testing email should be different from publisher account.
  5. If nothing works in the above, try removing google account on your phone and adding back and clearing data in Play Store.

Hope this helps :)

In my case my base64EncodedPublicKey was incorrect and also my inapp product was inactive . Be sure ur inapp product id is same as in the console.

Solved, It was only mistake of product Id, The product Id from Play-store and in app SKU_NAME should be same for in app billing.


It is not mention properly in iab sample project which one is productId
ie SKU_GAS ="gas" and SKU_PREMIUM="premium" in project
then
"gas" and "premium" must be available on play-store as productId .

I struggled with this error for hours. My product IDs were correct, app was published to Alpha, I activated the Alpha testers list, joined through the opt-in link but nothing was working.

In the end I discovered that you cannot use the same Gmail account that is used for the Developer Console. That was it, added another gmail account as a tester and used it for downloading the app and no more authentication errors.

Also, just a note making changes to the app and building a debug version caused the error to re-appear. Only signed release APKs can be used.

I was facing the same issue, using the correct Product ID for every In App Purchase item. My app was ready to publish on Google Play (with an APK in Alpha testing), but it wasn't submitted. The solution was to submit the app to review by the Google Play Developer Console team.

Hope it helps you!

Make sure you're logged into the Play Store with the test account. Restart the phone. It should work, at least in my case the restart was necessary.

Make sure you build and sign the application with the same Keystore that you signed the APK that was uploaded to Google Play Beta channel. I made the mistake of signing with different Keystores, and didn't notice it.

If you are using google samples (like trivial drive) it might happen because of old .aidl file. Receive the latest version to test your application.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM