google-play,in-app-billing"/>
  • 13
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

In the Android > Sample app > Trivial Drive when running the app I get the following when doing an IAP:

Error - Authentication is required. You need to sign into your Google Account

I've switched to a separate account on my phone with the testing account (i.e. the testing email address I've specified in the Developer Console) and followed all the steps here:

https://android.stackexchange.com/questions/20369/getting-authentication-is-required-when-trying-to-access-the-play-store

but no joy.

Any further suggestions?

==== UPDATE

I've since blasted away all Google Accounts on my phone and now have just 1 account - i.e. the Testing account.

And I've tried everything here: https://android.stackexchange.com/questions/20369/getting-authentication-is-required-when-trying-to-access-the-play-store

    • I'm signed into the testing Google Account. E.g. when I open the Play Store my testing email address appears in Store home. Is there somewhere else I'm supposed to be signed in?
    • You may be getting confused. I'm not using Google Drive. I'm using the Trivial Drive sample In App Purchase app that is supplied with the Android SDK.

I believe that Google now requires that the app is published as alpha version and a Google group specifically for testing is set up. I wasn't able to find this information in the official documentation (which means that Google probably didn't update it in quite some time), but here: https://help.gamesalad.com/hc/en-us/articles/203536123-7-6-In-App-Purchases-IAP-for-Google-Play

  • 53
Reply Report
    • In my case same error was coming due to mismatch in product id configured at Google developer console and that was used by app on phone.
    • In my case I already had the app as an Alpha version, but I hadnt setup any items to purchase. Right after I added a single item, on a test 3min later that error message was gone (replaced with another error message which is probably my fault). EDIT: after a couple more minutes the original error message is back. And when I tried to purchase a different product I got a 3rd different error message. So probably the information is still spreading on the servers, I will wait and try later. Ill edit here if I find out more info.
      • 1
    • This is what is did.. System settings > Apps > "All" (tab at top) > Google Play Store Then press buttons in order: "Force stop" and "Clear data" Exit Settings. Start the Play Store. Press at the top left top open the menu options.. Verify you have the correct account selected. Follow this link
    • @bademba i tried restarting the entire phone and that didn't work. but resetting the Google Play Store app as you describe did work. thank you.

I was having this issue and found a seperate solution to this problem.

In app purchases in Google Play have unique names, and in Google Play, they must all be lower case and no spaces. Therefore if your IAP is called 'myproduct' but you call the store and ask for 'MyProduct' somewhat strangely, you will see this error message:

'Authentication is required. You need to sign into your Google Account.'

The error message is so misleading.

  • 10
Reply Report

I have the same issue previously. Go to your google developer console and make sure your app is PUBLISHED to any version(alpha, beta or prod). Then, the In app purchase will work :)

  • 6
Reply Report

Try this,

first, Remove all google accounts. second, Clear Data of google play service. third, if you can uninstall update that do it or just restart the phone.

i had the same error and i have found this solution.

  • -3
Reply Report
      • 1
    • I'm running with just the Test account. I've cleared all data, uninstalled the update, restarted the phone and still have the same problem.