Skip to content

[tool_crash] Unhandled RPCError (-32000) in ScreenshotCommand.runSkia when Impeller is enabled #196119

Closed

Description

@bkonyi

Running flutter screenshot --type=skia against an app with Impeller enabled crashes flutter_tools with an unhandled vm_service.RPCError (RPCError at new _OutstandingRequest at package:vm_service/src/vm_service.dart-e893cf79).

The engine's _flutter.screenshotSkp service extension rejects SKP capture under Impeller with JSON-RPC error -32000 (Cannot capture SKP screenshot with Impeller enabled.). FlutterVmService._checkedCallServiceExtension rethrows non-disconnect RPCErrors, and ScreenshotCommand.runSkia (packages/flutter_tools/lib/src/commands/screenshot.dart) calls vmService.screenshotSkp() without catching vm_service.RPCError.

Error and stack trace:

_flutter.screenshotSkp: (-32000) Cannot capture SKP screenshot with Impeller enabled.

#0      new _OutstandingRequest (package:vm_service/src/vm_service.dart:278:32)
#1      VmService._call.<anonymous closure> (package:vm_service/src/vm_service.dart:1960:25)
#2      VmService._call (package:vm_service/src/vm_service.dart:1972:8)
#3      VmService.callServiceExtension (package:vm_service/src/vm_service.dart:1903:14)
#4      FlutterVmService._checkedCallServiceExtension (package:flutter_tools/src/vmservice.dart:784:18)
#5      FlutterVmService.screenshotSkp (package:flutter_tools/src/vmservice.dart:963:12)
#6      ScreenshotCommand.runSkia (package:flutter_tools/src/commands/screenshot.dart:150:48)
#8      ScreenshotCommand.runCommand (package:flutter_tools/src/commands/screenshot.dart:117:14)

ScreenshotCommand.runSkia should catch vm_service.RPCError and call throwToolExit with the engine's error message.

Related Issues & PRs

Activity

  1. added
    c: crashStack traces logged to the console
    toolAffects the "flutter" command-line tool. See also t: labels.
    P1High-priority issues at the top of the work list
    team-toolOwned by Flutter Tool team
    triaged-toolTriaged by Flutter Tool team
    on Nov 6, 2026
  2. GhagSagar23 commented on Nov 7, 2026

    @GhagSagar23
    Contributor

    Fix included in #190953 — runSkia now catches vm_service.RPCError and calls throwToolExit with the engine's error message, so flutter screenshot --type=skia against an Impeller-enabled app exits cleanly instead of crashing with an unhandled exception. Added a regression test in screenshot_command_test.dart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority issues at the top of the work listc: crashStack traces logged to the consolefound in release: 3.47Found to occur in 3.47t: top-crasherteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions