I am trying to migrate to the new Google SignIn with Credential Manager.
Following the documentation and ending up with this integration:
val option = GetGoogleIdOption.Builder()
.setFilterByAuthorizedAccounts(false)
.setServerClientId(WEB_CLIENT_ID)
.setAutoSelectEnabled(false)
.build()
val request = GetCredentialRequest.Builder()
.addCredentialOption(option)
.build()
val manager = CredentialManager.create(this)
lifecycleScope.launch {
try {
val credential = manager.getCredential(this@MyActivity, request)
print(credential)
}
catch (exception: GetCredentialException) {
println(exception)
}
}
Now, this seems to work on an emulator. It also works on my physical phone WHEN I setFilterByAuthorizedAccounts to true. However, when I do setFilterByAuthorizedAccounts to false and I try to getCredential, it throws the following exception:
Second failure launching com.android.credentialmanager/.CredentialSelectorActivity, giving up (Ask Gemini)
android.os.TransactionTooLargeException: data parcel size 609076 bytes
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(BinderProxy.java:586)
at android.app.IApplicationThread$Stub$Proxy.scheduleTransaction(IApplicationThread.java:1977)
at android.app.servertransaction.ClientTransaction.schedule(ClientTransaction.java:178)
at com.android.server.wm.ClientLifecycleManager.scheduleTransaction(ClientLifecycleManager.java:65)
at com.android.server.wm.ClientLifecycleManager.scheduleTransactionAndLifecycleItems(ClientLifecycleManager.java:143)
at com.android.server.wm.ActivityTaskSupervisor.realStartActivityLocked(ActivityTaskSupervisor.java:956)
at com.android.server.wm.RootWindowContainer$AttachApplicationHelper.test(RootWindowContainer.java:3805)
at com.android.server.wm.RootWindowContainer$AttachApplicationHelper.test(RootWindowContainer.java:3755)
at com.android.server.wm.ActivityRecord.forAllActivities(ActivityRecord.java:4743)
at com.android.server.wm.WindowContainer.forAllActivities(WindowContainer.java:1831)
at com.android.server.wm.WindowContainer.forAllActivities(WindowContainer.java:1825)
at com.android.server.wm.RootWindowContainer$AttachApplicationHelper.accept(RootWindowContainer.java:3793)
at com.android.server.wm.RootWindowContainer$AttachApplicationHelper.accept(RootWindowContainer.java:3755)
at com.android.server.wm.Task.forAllRootTasks(Task.java:3198)
at com.android.server.wm.WindowContainer.forAllRootTasks(WindowContainer.java:2212)
at com.android.server.wm.WindowContainer.forAllRootTasks(WindowContainer.java:2212)
at com.android.server.wm.WindowContainer.forAllRootTasks(WindowContainer.java:2212)
at com.android.server.wm.WindowContainer.forAllRootTasks(WindowContainer.java:2212)
at com.android.server.wm.WindowContainer.forAllRootTasks(WindowContainer.java:2212)
at com.android.server.wm.WindowContainer.forAllRootTasks(WindowContainer.java:2212)
at com.android.server.wm.WindowContainer.forAllRootTasks(WindowContainer.java:2205)
at com.android.server.wm.RootWindowContainer$AttachApplicationHelper.process(RootWindowContainer.java:3771)
at com.android.server.wm.RootWindowContainer.attachApplication(RootWindowContainer.java:1858)
at com.android.server.wm.ActivityTaskManagerService$LocalService.attachApplication(ActivityTaskManagerService.java:6582)
at com.android.server.am.ActivityManagerService.finishAttachApplicationInner(ActivityManagerService.java:4904)
at com.android.server.am.ActivityManagerService.finishAttachApplication(ActivityManagerService.java:5006)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2750)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2798)
at android.os.Binder.execTransactInternal(Binder.java:1496)
at android.os.Binder.execTransact(Binder.java:1440)
The way I see it is that because I'm setting the setFilterByAuthorizedAccounts to false, then the Credential Manager is trying to get a lot more accounts and is causing this TransactionTooLargeException. The max Parcel size is 500KB and in this case, the Parcel size is around 600KB, causing the Exception.
Now, my question is - besides reporting this issue and waiting for a fix, is there anything I can do to overcome it? Maybe increase the Transaction max size?