Repository navigation
Description
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.
Activity
address review: fix analyzer warnings, add FakeAndroidDevice override…
GhagSagar23 commentedon Nov 7, 2026
Fix included in #190953 —
runSkianow catchesvm_service.RPCErrorand callsthrowToolExitwith the engine's error message, soflutter screenshot --type=skiaagainst an Impeller-enabled app exits cleanly instead of crashing with an unhandled exception. Added a regression test inscreenshot_command_test.dart.[flutter_tools] Polish screenshot Skia integration test
[flutter_tools] Handle RPCError in ScreenshotCommand.runSkia (flutter…