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

Cannot find symbol variable GoogleAuthUtil after updating to Google Play services 9.0.0

编译错误:

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

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