2017-05-24 74 views
0

我刚开始推行谷歌登录API,这是我的配置:谷歌播放服务登录的内部错误

我将此添加到摇篮:

compile 'com.google.android.gms:play-services:10.2.6' 

这是我的OnCreate:

gso=new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN) 
      .requestEmail() 
      .build(); 

    googleApiClient=new GoogleApiClient.Builder(this) 
      .enableAutoManage(this,this) 
      .addApi(Auth.GOOGLE_SIGN_IN_API,gso) 
      .build(); 

这是我如何调用登录过程:

Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(googleApiClient); 
    startActivityForResult(signInIntent, GOOGLE_SIGNIN_ID); 

但它不工作,它说,谷歌Play服务已停止工作,在日志中它说:“内部错误”

我已经挂我的应用程序服务,我有代码的oauth2,我不不知道我做错了什么,并且非常绝望,谢谢你的帮助。

+0

您可能要检查[疑难解答在您的Android游戏(https://developers.google.com/游戏/服务/安卓/故障排除)。检查你的包名称和证书指纹的建议在[相关SO帖子](https://stackoverflow.com/questions/34942692/occured-an-internal-error-when-requestemail-from-googlesigninoptions-android)也可能有帮助。 – Teyam

+0

我已经设法使它工作,我认为.json配置文件不起作用,无论如何感谢您的时间 – Matthew

回答

0

使用签名证书的SHA-1散列添加配置文件。

Configuration file to your project

在你的Android Studio项目的app目录中添加谷歌,services.json

+0

我跟着链接,它将我重定向到Firebase,我从那里得到了json,并复制它到我的应用程序文件夹,仍然无法正常工作。 – Matthew