Connection to google Play Services Failed

19,647

Solution 1

I had a similar error recently. I solved it by adding the correct information in the Google APIs Console, specifically in the API Access pane.

In my case I was missing an OAuthClient 2.0 id. Documentation here

Solution 2

One more suggestion from me, if someone will need it in the future. Except the API settings and Google Console Authentication process pay attention on a little detail: on Google Console it is necessary that the application has a Product Name from Apis&Auth -> Consent Screen(see the image below). In my case i didnt set a product name and that was the reason of the SIGN_IN_REQUIRED error.

Product name from Google Console

Solution 3

This problem occurs in two cases:

1) Google Play services library is not included correctly.

2) Dev console is not setup right. (Also if you just setup your dev console, it takes few minutes to propagate sometimes.)

Share:
19,647
idan
Author by

idan

Updated on June 06, 2022

Comments

  • idan
    idan about 2 years

    i trying to upload video using this YouTube Direct Lite App for Android project https://code.google.com/p/ytd-android/

    I performed all the steps mentioned in the link.

    the appliction run in my android device fine but i recive toast "Connection to Play Services failed" and "An internal error occurred" toast.

    and this log error:

    05-07 11:17:33.659: E/com.google.ytdl.UploadsListFragment(3140): Connection to Play Services Failed, error: 4, reason: ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{41836358: android.os.BinderProxy@41779308}}
    

    In order to find out what the problem is, i chacked the api key that i generated in here :

    https://code.google.com/apis/console

    Simple API Access
    Use API keys to identify your project when you do not need to access user data. Learn more
    Key for Android apps (with certificates)
    API key:    
    xxxxxxxxxxxxxxxxxx
    Android apps:   
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx;com.google.ytdl
    Activated on:   Apr 16, 2013 11:30 AM
    Activated by:    [email protected] – you
    

    and it look fine.

    i red those links : https://developers.google.com/+/mobile/android/sign-in http://developer.android.com/google/play-services/auth.html#choose

    Anyone encountered this and know what is due to the problem? The only thing I can think of it's the api key but it seems proper, help ...

    edite :

    Access Token

     mToken =
                  GoogleAuthUtil.getToken(MainActivity.this, mChosenAccountName, "oauth2:"
                      + Scopes.PLUS_PROFILE + " " + YouTubeScopes.YOUTUBE + " "
                      + YouTubeScopes.YOUTUBE_UPLOAD);
    
  • idan
    idan about 11 years
    thank you , your answer is very helpful. I entered again to Google APIs Console start from the begining all the process and added anew KEY, suddenly all the error stopped but still not working , after i choose video it's return to the begin screen and do nothing...
  • idan
    idan about 11 years
    Can you specify a bit more what you add, are you add something that was not clear that we needed to add ?
  • DigCamara
    DigCamara about 11 years
    You have to add your app's information. If the toast "An internal error occurred" doesn't show up any more, you did it correctly. However, you may need to add permissions to other APIS (under the "Services" pane). In my case it was all I needed, but then again, I wasn't using the YouTube API but only the Google Plus API (which was what my answer was addressing)
  • idan
    idan about 11 years
    work.................. i do nothing maybe have to wait a while until is updated .... I do not know ...
  • Emanuel Canha
    Emanuel Canha about 9 years
    In my case it was the Email Address that for some reason did not get saved.