{"record":{"id":"7071effa1bf709a4","repo":"microg/GmsCore","slug":"missing-required-properties-account","errorCode":null,"errorMessage":"Missing required properties: account","messagePattern":"Missing required properties: account","errorType":"validation","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/RevokeAccessRequest.java","lineNumber":60,"sourceCode":"        this.account = account;\n        this.sessionId = sessionId;\n    }\n\n    /**\n     * Returns a new {@link RevokeAccessRequest.Builder}.\n     */\n    @NonNull\n    public static RevokeAccessRequest.Builder builder() {\n        return new Builder() {\n            private List<Scope> scopes;\n            private Account account;\n            private String sessionId;\n\n            @NonNull\n            @Override\n            public RevokeAccessRequest build() {\n                if (scopes == null) throw new IllegalStateException(\"Missing required properties: scopes\");\n                if (account == null) throw new IllegalStateException(\"Missing required properties: account\");\n                return new RevokeAccessRequest(scopes, account, sessionId);\n            }\n\n            @NonNull\n            @Override\n            public Builder setAccount(@NonNull Account account) {\n                this.account = account;\n                return this;\n            }\n\n            @NonNull\n            @Override\n            public Builder setScopes(@NonNull List<Scope> scopes) {\n                this.scopes = scopes;\n                return this;\n            }\n\n            @NonNull","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/microg/GmsCore/blob/157c9d86ac46c195a86c2f15ab55c84036223f95/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/RevokeAccessRequest.java#L42-L78","documentation":"RevokeAccessRequest.Builder.build() checks account after scopes; when scopes is set but setAccount(...) was never called, it throws IllegalStateException 'Missing required properties: account'. Revocation must be tied to a specific Google account.","triggerScenarios":"RevokeAccessRequest.builder().setScopes(...).build() without setAccount(Account).","commonSituations":"The signed-in account is null (user not signed in, or GoogleSignIn.getLastSignedInAccount returned null) and the null was passed/skipped silently; ordering bugs where build() runs before account resolution completes.","solutions":["Resolve the account first (e.g. GoogleSignIn.getLastSignedInAccount(context)) and abort if null before building the request.","Call setAccount(account) with the non-null Account before build().","If no account exists, the revocation is meaningless — skip the API call and route the user to sign-in."],"exampleFix":"// before\nRevokeAccessRequest req = RevokeAccessRequest.builder().setScopes(scopes).build();\n// after\nAccount account = GoogleSignIn.getLastSignedInAccount(context).getAccount();\nif (account == null) return; // not signed in\nRevokeAccessRequest req = RevokeAccessRequest.builder().setScopes(scopes).setAccount(account).build();","handlingStrategy":"validation","validationCode":"Account account = GoogleSignIn.getLastSignedInAccount(context) != null ? GoogleSignIn.getLastSignedInAccount(context).getAccount() : null;\nif (account == null) { routeToSignIn(); return; }","typeGuard":null,"tryCatchPattern":"try { req = RevokeAccessRequest.builder().setScopes(scopes).setAccount(account).build(); } catch (IllegalStateException e) { log.warn(\"RevokeAccessRequest missing account\", e); }","preventionTips":["Resolve the signed-in account before constructing auth requests.","Treat a null sign-in result as a hard early-return from revocation flows.","Keep account resolution and request building in the same function to avoid ordering bugs."],"tags":["android","identity","oauth","builder","required-property"],"backgroundTag":"missing-required-argument","analyzedSha":"157c9d86ac46c195a86c2f15ab55c84036223f95","analyzedAt":"2026-09-06T17:27:33.892Z","contentChangedAt":"2026-09-06T17:27:33.892Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}