连接到 Google Play 服务失败

ida*_*dan 3 android youtube-api google-api-java-client google-play-services

我尝试使用适用于 Android 项目的YouTube Direct Lite 应用程序上传视频https://code.google.com/p/ytd-android/

我执行了链接中提到的所有步骤。

该应用程序在我的 android 设备上运行良好,但我收到吐司“连接播放服务失败”和“发生内部错误”吐司。

和这个日志错误:

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}}
Run Code Online (Sandbox Code Playgroud)

为了找出问题所在,我在这里生成了 api 密钥:

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
Run Code Online (Sandbox Code Playgroud)

它看起来不错。

我红色这些链接:https : //developers.google.com/+/mobile/android/sign-in http://developer.android.com/google/play-services/auth.html#choose

任何人都遇到过这个问题并知道是什么原因造成的?我唯一能想到的就是 api 密钥,但它似乎是正确的,帮助...

编辑:

访问令牌

 mToken =
              GoogleAuthUtil.getToken(MainActivity.this, mChosenAccountName, "oauth2:"
                  + Scopes.PLUS_PROFILE + " " + YouTubeScopes.YOUTUBE + " "
                  + YouTubeScopes.YOUTUBE_UPLOAD);
Run Code Online (Sandbox Code Playgroud)

Dig*_*ara 5

我最近有类似的错误。我通过在 Google API 控制台中添加正确的信息来解决它,特别是在 API 访问窗格中。

就我而言,我缺少 OAuthClient 2.0 id。文档在这里