Connection to google Play Services Failed

一个人想着一个人 提交于 2019-12-05 04:23:40

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!