Ladybug2024.2.1にアップデートしたところ、Lintが次のメッセージで失敗するようになりました。
Error: Use of :googleid classes without use of GoogleIdTokenCredential [CredentialManagerSignInWithGoogle]
val googleIdOption = GetGoogleIdOption.Builder()
~~~~~~~~~~~~~~~~~
Explanation for issues of type "CredentialManagerSignInWithGoogle":
When using :googleid classes like GetGoogleIdOption and
GetSignInWithGoogleOption, you typically must handle the response using
GoogleIdTokenCredential.TYPE_GOOGLE_ID_TOKEN_CREDENTIAL or
GoogleIdTokenCredential.TYPE_GOOGLE_ID_TOKEN_SIWG_CREDENTIAL.
This check reports all uses of these :googleid classes if there are no
references to GoogleIdTokenCredential.
https://developer.android.com/identity/sign-in/credential-manager-siwg#create-sign
メッセージを読む限り、本来の意図としては
val googleIdOption = GetGoogleIdOption.Builder().build()
がある場合に
GoogleIdTokenCredential.TYPE_GOOGLE_ID_TOKEN_CREDENTIAL
があるかどうかを確認しているようです。
しかし、テストコードを読むと、次のような記述があります。
// The code that references the Google ID classes is in a library module;
// the warning should still be reported when we reach the app module.
どうやら、ライブラリモジュール内でGoogle ID
への参照があると警告を出すようです。
(ここからは個人の意見です)
UIレイヤで実行すべき、というのは理解できますが、アプリケーションモジュールで必ず実行しないといけない、というのは制約としてやや強すぎる気がします。
一時的な対処として CredentialManagerSignInWithGoogle
のLintをdisableにして様子を見るのが良さそうです。