问题
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: xxxxx@gmail.com – 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);
回答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
回答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.

回答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.)
来源:https://stackoverflow.com/questions/16414584/connection-to-google-play-services-failed