我根据这篇博客与谷歌的流程来实现新的登录:api-updates-for-sign-in-with-google登录在与谷歌游戏服务
但是在登录我得到以下异常:
IllegalStateException: Auth.GOOGLE_SIGN_IN_API cannot be used with Games.API
我建设我GoogleApiClient
这样的:
final GoogleSignInOptions googleSignInOptions = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.build();
mGoogleApiClient = new GoogleApiClient.Builder(this)
.enableAutoManage(this, this)
.addApi(Auth.GOOGLE_SIGN_IN_API, googleSignInOptions)
.addApi(Games.API)
.build();
当我删除.addApi(Auth.GOOGLE_SIGN_IN_API, googleSignInOptions)
我得到以下exceptoin:
java.lang.NullPointerException: Appropriate Api was not requested.
我缺少的东西或新的流动不支持Games.API
?
请阅读https://plus.google.com/+EtienneLawlor/posts/AB9rq2B69k3 – BNK
而这个链接http://android-developers.blogspot.com/2016/01/play-games-permissions-are-changing -in.html,你可以注意'问题:询问不必要的作用域'和'解决方案:只询问你需要的作用域' – BNK
我在这里要求什么不必要的范围? – maclir