更新到Google Play服务9.0.0后找不到符号变量GoogleAuthUtil

时间:2016-05-19 15:26:38

标签: android google-play-services google-signin google-plus-signin googlesigninapi

编译错误:

Error:(xx, xx) error: package com.google.android.gms.auth does not exist
Error:(xx, xx) error: cannot find symbol variable GoogleAuthUtil

1 个答案:

答案 0 :(得分:20)

GoogleAuthUtil已转移到Google Play服务9.0+ SDK中的-auth SDK分割。

如果您需要在Android上访问REST API,请在build.gradle文件中包含-auth拆分:

compile 'com.google.android.gms:play-services-auth:9.0.0'

否则,我们建议您将应用迁移到Google Sign-In API,以便将最新的安全性和用户体验改进整合到您的应用中。

请阅读迁移指南: https://developers.google.com/identity/sign-in/android/migration-guide#migrate_from_the_googleauthutil_id_token_flow

更多细节的博客文章: http://android-developers.blogspot.com/2016/05/improving-security-and-user-experience.html