{"record":{"id":"f49cd9e869997158","repo":"microg/GmsCore","slug":"onsuccesstask-is-not-implemented","errorCode":null,"errorMessage":"onSuccessTask is not implemented","messagePattern":"onSuccessTask is not implemented","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"play-services-tasks/src/main/java/com/google/android/gms/tasks/Task.java","lineNumber":277,"sourceCode":"     */\n    public abstract boolean isComplete();\n\n    /**\n     * Returns {@code true} if the Task has completed successfully; {@code false} otherwise.\n     */\n    public abstract boolean isSuccessful();\n\n    /**\n     * Returns a new Task that will be completed with the result of applying the specified SuccessContinuation to this Task when this Task completes successfully. If the previous Task fails, the onSuccessTask completion will be skipped and failure listeners will be invoked.\n     * <p>\n     * The SuccessContinuation will be called on the main application thread.\n     * <p>\n     * If the previous Task is canceled, the returned Task will also be canceled and the SuccessContinuation would not execute.\n     *\n     * @see SuccessContinuation#then\n     */\n    public <TContinuationResult> Task<TContinuationResult> onSuccessTask(SuccessContinuation<TResult, TContinuationResult> successContinuation) {\n        throw new UnsupportedOperationException(\"onSuccessTask is not implemented\");\n    }\n\n    /**\n     * Returns a new Task that will be completed with the result of applying the specified SuccessContinuation to this Task when this Task completes successfully. If the previous Task fails, the onSuccessTask completion will be skipped and failure listeners will be invoked.\n     * <p>\n     * If the previous Task is canceled, the returned Task will also be canceled and the SuccessContinuation would not execute.\n     *\n     * @param executor the executor to use to call the SuccessContinuation\n     * @see SuccessContinuation#then\n     */\n    public <TContinuationResult> Task<TContinuationResult> onSuccessTask(Executor executor, SuccessContinuation<TResult, TContinuationResult> successContinuation) {\n        throw new UnsupportedOperationException(\"onSuccessTask is not implemented\");\n    }\n\n}\n","sourceCodeStart":259,"sourceCodeEnd":293,"githubUrl":"https://github.com/microg/GmsCore/blob/157c9d86ac46c195a86c2f15ab55c84036223f95/play-services-tasks/src/main/java/com/google/android/gms/tasks/Task.java#L259-L293","documentation":"The no-executor onSuccessTask(SuccessContinuation) overload is an unimplemented stub: it throws UnsupportedOperationException unconditionally. Success-only task chaining (running a follow-up task only when this task succeeds) is not available through this method.","triggerScenarios":"Calling task.onSuccessTask(successContinuation) on any Task — always throws.","commonSituations":"Ported Firebase code using onSuccessTask for sequential async flows; copying official Play Services samples against this implementation.","solutions":["Use the library's supported composition API instead","Guard inside addOnSuccessListener/addOnCompleteListener and launch the next task only when isSuccessful() is true","Catch UnsupportedOperationException and fall back to listener-based chaining","Refactor the SuccessContinuation logic into a normal listener callback"],"exampleFix":"// before\ntask.onSuccessTask(t -> fetchProfile(t.getResult()));\n// after\ntask.addOnSuccessListener(result -> fetchProfile(result));","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    Task<R> r = task.onSuccessTask(cont);\n} catch (UnsupportedOperationException e) {\n    task.addOnSuccessListener(result -> { /* launch next task */ });\n}","preventionTips":["Use addOnSuccessListener for success-only chaining","Grep ported code for onSuccessTask and rewrite before running","Skip the SuccessContinuation when isSuccessful() is false, mirroring intended semantics","Prefer explicit listener composition in this library"],"tags":["tasks","unsupported-operation","on-success-task","android"],"backgroundTag":"unsupported-operation","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"}