microg/GmsCore · error · UnsupportedOperationException

continueWithTask is not implemented

Error message

continueWithTask is not implemented

What it means

The no-executor continueWithTask(Continuation) overload is an unimplemented stub in this library's Task class: it throws UnsupportedOperationException unconditionally. Task chaining that returns a nested Task is not supported through this entry point.

Source

Thrown at play-services-tasks/src/main/java/com/google/android/gms/tasks/Task.java:213

     * @see Continuation#then(Task)
     */
    public <TContinuationResult> Task<TContinuationResult> continueWith(Executor executor, Continuation<TResult, TContinuationResult> continuation) {
        throw new UnsupportedOperationException("continueWith is not implemented");
    }

    /**
     * Returns a new Task that will be completed with the result of applying the specified
     * Continuation to this Task.
     * <p/>
     * The Continuation will be called on the main application thread.
     * <p/>
     * If the previous Task is canceled, the Continuation would still execute and task.isCanceled() is true can be
     * observed in the Continuation.
     *
     * @see Continuation#then(Task)
     */
    public <TContinuationResult> Task<TContinuationResult> continueWithTask(Continuation<TResult, Task<TContinuationResult>> continuation) {
        throw new UnsupportedOperationException("continueWithTask is not implemented");
    }

    /**
     * Returns a new Task that will be completed with the result of applying the specified Continuation to this Task.
     * <p/>
     * If the previous Task is canceled, the Continuation would still execute and task.isCanceled() is true can be
     * observed in the Continuation.
     *
     * @param executor the executor to use to call the Continuation
     * @see Continuation#then(Task)
     */
    public <TContinuationResult> Task<TContinuationResult> continueWithTask(Executor executor, Continuation<TResult, Task<TContinuationResult>> continuation) {
        throw new UnsupportedOperationException("continueWithTask is not implemented");
    }

    /**
     * Returns the exception that caused the Task to fail. Returns {@code null} if the Task is not
     * yet complete, or completed successfully.

View on GitHub (pinned to 157c9d86ac)

Solutions

  1. Use the supported task-composition API of this library instead of continueWithTask
  2. Replace with addOnCompleteListener and manually start the follow-up task inside the listener
  3. Catch UnsupportedOperationException and implement a fallback composition with listeners
  4. Encapsulate chaining in a helper that awaits completion then invokes the next task

Example fix

// before
task.continueWithTask(t -> fetchMore(t.getResult()));
// after
task.addOnCompleteListener(t -> {
    if (t.isSuccessful()) {
        Task<More> next = fetchMore(t.getResult());
    }
});
Defensive patterns

Strategy: try-catch

Try / catch

try {
    Task<R> r = task.continueWithTask(cont);
} catch (UnsupportedOperationException e) {
    task.addOnCompleteListener(t -> { /* launch next task manually */ });
}

Prevention

When it happens

Trigger: Calling task.continueWithTask(continuation) with a Continuation returning Task<TContinuationResult>, with no Executor argument — always throws immediately.

Common situations: Migrating Firebase/GMS task code that composes async calls via continueWithTask; following Play Services tutorials against this reimplementation.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of microg/GmsCore@157c9d86ac (2026-09-06). Data as JSON: /api/errors/1f61d4488e0c5759. Report an issue: GitHub.