A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed

Edited by Moderator
Most users report that this issue exist only on v3.3.x or earlier.
Please only report if this error exists on v3.4.0 or later.
When reporting, please make sure to add your flutter doctor -v result as well as reproduction steps. Thank you.

Steps to Reproduce

In Windows 10, Execute flutter run on the code sample
Click in the app
Hold down the left control key
While holding it, click or move the mouse - see the error

Expected results:
Want the logged bug not to happen
Actual results:
======== Exception caught by services library ======================================================
The following assertion was thrown during a platform message callback:
A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model as documented in `HardwareKeyboard`. This was the event: KeyRepeatEvent#bae6a(physicalKey: PhysicalKeyboardKey#700e0(usbHidUsage: "0x000700e0", debugName: "Control Left"), logicalKey: LogicalKeyboardKey#00100(keyId: "0x200000100", keyLabel: "Control Left", debugName: "Control Left"), character: null, timeStamp: 50:55:02.589706)
'package:flutter/src/services/hardware_keyboard.dart':
Failed assertion: line 432 pos 16: '_pressedKeys.containsKey(event.physicalKey)'

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.md

When the exception was thrown, this was the stack:
#2      HardwareKeyboard._assertEventIsRegular.<anonymous closure> (package:flutter/src/services/hardware_keyboard.dart:432:16)
#3      HardwareKeyboard._assertEventIsRegular (package:flutter/src/services/hardware_keyboard.dart:443:6)
#4      HardwareKeyboard.handleKeyEvent (package:flutter/src/services/hardware_keyboard.dart:535:5)
#5      KeyEventManager.handleRawKeyMessage (package:flutter/src/services/hardware_keyboard.dart:881:37)
#6      BasicMessageChannel.setMessageHandler.<anonymous closure> (package:flutter/src/services/platform_channel.dart:197:49)
#7      _DefaultBinaryMessenger.setMessageHandler.<anonymous closure> (package:flutter/src/services/binding.dart:387:35)
#8      _invoke2 (dart:ui/hooks.dart:186:13)
#9      _ChannelCallbackRecord.invoke (dart:ui/channel_buffers.dart:42:5)
#10     _Channel.push (dart:ui/channel_buffers.dart:132:31)
#11     ChannelBuffers.push (dart:ui/channel_buffers.dart:329:17)
#12     PlatformDispatcher._dispatchPlatformMessage (dart:ui/platform_dispatcher.dart:599:22)
#13     _dispatchPlatformMessage (dart:ui/hooks.dart:89:31)
(elided 2 frames from class _AssertionError)
====================================================================================================

Code sample

import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class UndoIntent extends Intent {
  const UndoIntent();
}

class _MyHomePageState extends State<MyHomePage> {
  FocusNode myFocusNode = new FocusNode();

  Widget wrapFocus(Widget child) {
    print("Wrapping focus");
    return Focus(
        child: child,
        onFocusChange: (focused) {
          print("Focus changed to $focused");
        },
        // focusNode: myFocusNode
    );
  }

  Widget buildViewport(BuildContext context) {
    final Map<ShortcutActivator, Intent> activators;
    activators = <ShortcutActivator, Intent>{
      const SingleActivator(LogicalKeyboardKey.keyZ, control: true): const UndoIntent(),
    };

    return Shortcuts(
        shortcuts: activators,
        child: wrapFocus(Actions(actions: <Type, Action<Intent>>{
          UndoIntent: CallbackAction<UndoIntent>(
            onInvoke: (UndoIntent intent) =>
                setState(() {
                  print("Undo action");
                }),
          ),
        },
          child: Container(
            child: CustomPaint(
              size: const Size(100, 100),
            painter: MyPainter(context),
          ),
        ))));
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Column(
        children: [
          Container(width: 20, height:50, color: Colors.red),
          buildViewport(context),
        ]
      ),
    );
  }
}

class MyPainter extends CustomPainter {
  BuildContext context;
  MyPainter(this.context);

  @override
  bool shouldRepaint(CustomPainter oldDelegate) {
    return true;
  }

  @override
  void paint(Canvas canvas, Size size) {
    var text = '$size';
    TextSpan span = TextSpan(style: const TextStyle(color: Colors.black, fontSize: 12.0, fontFamily: 'Roboto'), text: text);
    TextPainter tp = TextPainter(text: span, textDirection: TextDirection.ltr, textAlign: TextAlign.center);
    tp.layout();
    var pt = Offset(150, 150);
    tp.paint(canvas, Offset(pt.dx - tp.width / 2, pt.dy - tp.height / 2));

    // diagonal line
    canvas.drawLine(Offset.zero, Offset(size.width, size.height), Paint()..color = Colors.black);
  }
}

My pubspec.yaml is
name: ftest
description: A new Flutter project.
The following line prevents the package from being accidentally published to
pub.dev using flutter pub publish. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
The following defines the version and build number for your application.
A version number is three numbers separated by dots, like 1.2.43
followed by an optional build number separated by a +.
Both the version and the builder number may be overridden in flutter
build by specifying --build-name and --build-number, respectively.
In Android, build-name is used as versionName while build-number used as versionCode.
Read more about Android versioning at https://developer.android.com/studio/publish/versioning
In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
Read more about iOS versioning at
https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
environment:
sdk: ">=2.12.0 <3.0.0"
Dependencies specify other packages that your package needs in order to work.
To automatically upgrade your package dependencies to the latest versions
consider running flutter pub upgrade --major-versions. Alternatively,
dependencies can be manually updated by changing the version numbers below to
the latest version available on pub.dev. To see which dependencies have newer
versions available, run flutter pub outdated.
dependencies:
flutter:
sdk: flutter
The following adds the Cupertino Icons font to your application.
Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
dev_dependencies:
flutter_test:
sdk: flutter
The "flutter_lints" package below contains a set of recommended lints to
encourage good coding practices. The lint set provided by the package is
activated in the analysis_options.yaml file located at the root of your
package. See that file for information about deactivating specific lint
rules and activating additional ones.
flutter_lints: ^1.0.0
For information on the generic Dart part of this file, see the
following page: https://dart.dev/tools/pub/pubspec
The following section is specific to Flutter.
flutter:
The following line ensures that the Material Icons font is
included with your application, so that you can use the icons in
the material Icons class.
uses-material-design: true
To add assets to your application, add an assets section, like this:
assets:
- images/a_dot_burr.jpeg
- images/a_dot_ham.jpeg
An image asset can refer to one or more resolution-specific "variants", see
https://flutter.dev/assets-and-images/#resolution-aware.
For details regarding adding assets from package dependencies, see
https://flutter.dev/assets-and-images/#from-packages
To add custom fonts to your application, add a fonts section here,
in this "flutter" section. Each entry in this list should have a
"family" key with the font family name, and a "fonts" key with a
list giving the asset and other descriptors for the font. For
example:
fonts:
- family: Schyler
fonts:
- asset: fonts/Schyler-Regular.ttf
- asset: fonts/Schyler-Italic.ttf
style: italic
- family: Trajan Pro
fonts:
- asset: fonts/TrajanPro.ttf
- asset: fonts/TrajanPro_Bold.ttf
weight: 700

For details regarding fonts from package dependencies,
see https://flutter.dev/custom-fonts/#from-packages

Logs

[  +58 ms] executing: [c:\working\opensrc\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[  +84 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[        ] a4ba62fd9defa3b905eee50f7311fa6561228ea1
[        ] executing: [c:\working\opensrc\flutter/] git tag --points-at a4ba62fd9defa3b905eee50f7311fa6561228ea1
[  +75 ms] Exit code 0 from: git tag --points-at a4ba62fd9defa3b905eee50f7311fa6561228ea1
[   +1 ms] executing: [c:\working\opensrc\flutter/] git describe --match *.*.* --long --tags a4ba62fd9defa3b905eee50f7311fa6561228ea1
[ +135 ms] Exit code 0 from: git describe --match *.*.* --long --tags a4ba62fd9defa3b905eee50f7311fa6561228ea1
[        ] 3.0.0-0.0.pre-1698-ga4ba62fd9d
[  +39 ms] executing: [c:\working\opensrc\flutter/] git rev-parse --abbrev-ref --symbolic @{upstream}
[  +53 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{upstream}
[        ] origin/master
[        ] executing: [c:\working\opensrc\flutter/] git ls-remote --get-url origin
[  +57 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[ +274 ms] Unable to locate an Android SDK.
[   +2 ms] executing: [c:\working\opensrc\flutter/] git rev-parse --abbrev-ref HEAD
[  +51 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] master
[  +69 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +97 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[   +4 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +70 ms] Skipping pub get: version match.
[  +95 ms] Generating C:\working\flutter\ftest\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java
[  +84 ms] Initializing file store
[  +10 ms] Skipping target: gen_localizations
[   +5 ms] gen_dart_plugin_registrant: Starting due to {InvalidatedReasonKind.inputChanged: The following inputs have updated contents: C:\working\flutter\ftest\.dart_tool\package_config_subset}
[  +22 ms] gen_dart_plugin_registrant: Complete
[   +1 ms] Skipping target: _composite
[   +1 ms] complete
[   +6 ms] Launching lib\main.dart on Windows in debug mode...
[   +3 ms] c:\working\opensrc\flutter\bin\cache\dart-sdk\bin\dart.exe --disable-dart-dev c:\working\opensrc\flutter\bin\cache\dart-sdk\bin\snapshots\frontend_server.dart.snapshot --sdk-root c:\working\opensrc\flutter\bin\cache\artifacts\engine\common\flutter_patched_sdk/ --incremental --target=flutter --debugger-module-names --experimental-emit-debug-metadata -DFLUTTER_WEB_AUTO_DETECT=true --output-dill C:\Users\dave\AppData\Local\Temp\flutter_tools.efd4394f\flutter_tool.d55fe25c\app.dill --packages C:\working\flutter\ftest\.dart_tool\package_config.json -Ddart.vm.profile=false -Ddart.vm.product=false --enable-asserts --track-widget-creation --filesystem-scheme org-dartlang-root --initialize-from-dill build\c075001b96339384a97db4862b8ab8db.cache.dill.track.dill --verbosity=error --flutter-widget-cache --enable-experiment=alternative-invalidation-strategy
[  +21 ms] executing: C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe -format json -products * -utf8 -latest -version 16 -requires Microsoft.VisualStudio.Workload.NativeDesktop Microsoft.VisualStudio.Component.VC.Tools.x86.x64 Microsoft.VisualStudio.Component.VC.CMake.Project
[  +46 ms] Exit code 0 from: C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe -format json -products * -utf8 -latest -version 16 -requires Microsoft.VisualStudio.Workload.NativeDesktop Microsoft.VisualStudio.Component.VC.Tools.x86.x64 Microsoft.VisualStudio.Component.VC.CMake.Project
[        ] [
             {
               "instanceId": "b461ce63",
               "installDate": "2020-11-16T15:21:45Z",
               "installationName": "VisualStudio/16.8.1+30711.63",
               "installationPath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community",
               "installationVersion": "16.8.30711.63",
               "productId": "Microsoft.VisualStudio.Product.Community",
               "productPath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\devenv.exe",
               "state":<PHONE_NUMBER>,
               "isComplete": true,
               "isLaunchable": true,
               "isPrerelease": false,
               "isRebootRequired": false,
               "displayName": "Visual Studio Community 2019",
               "description": "Powerful IDE, free for students, open-source contributors, and individuals",
               "channelId": "VisualStudio.16.Release",
               "channelUri": "https://aka.ms/vs/16/release/channel",
               "enginePath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\resources\\app\\ServiceHub\\Services\\Microsoft.VisualStudio.Setup.Service",
               "releaseNotes": "https://go.microsoft.com/fwlink/?LinkId=660893#16.8.1",
               "thirdPartyNotices": "https://go.microsoft.com/fwlink/?LinkId=660909",
               "updateDate": "2020-11-16T15:21:45.3109557Z",
               "catalog": {
                 "buildBranch": "d16.8",
                 "buildVersion": "16.8.30711.63",
                 "id": "VisualStudio/16.8.1+30711.63",
                 "localBuild": "build-lab",
                 "manifestName": "VisualStudio",
                 "manifestType": "installer",
                 "productDisplayVersion": "16.8.1",
                 "productLine": "Dev16",
                 "productLineVersion": "2019",
                 "productMilestone": "RTW",
                 "productMilestoneIsPreRelease": "False",
                 "productName": "Visual Studio",
                 "productPatchVersion": "1",
                 "productPreReleaseMilestoneSuffix": "1.0",
                 "productSemanticVersion": "16.8.1+30711.63",
                 "requiredEngineVersion": "2.8.3267.30329"
               },
               "properties": {
                 "campaignId": "",
                 "channelManifestId": "VisualStudio.16.Release/16.8.1+30711.63",
                 "nickname": "",
                 "setupEngineFilePath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vs_installershell.exe"
               }
             }
           ]
[   +2 ms] Building Windows application...
[  +12 ms] <- compile package:ftest/main.dart
[   +1 ms] executing: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe -S C:\working\flutter\ftest\windows -B build\windows -G Visual Studio 16 2019
[  +65 ms] -- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.19042.
[  +19 ms] -- Configuring done
[ +181 ms] -- Generating done
[  +11 ms] -- Build files have been written to: C:/working/flutter/ftest/build/windows
[   +5 ms] executing: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe --build build\windows --config Debug --target INSTALL --verbose
[ +140 ms] Microsoft (R) Build Engine version 16.8.1+bd2ea1e3c for .NET Framework
[        ] Copyright (C) Microsoft Corporation. All rights reserved.
[  +59 ms] Build started 19/07/2022 23:26:25.
[ +268 ms] Project "C:\working\flutter\ftest\build\windows\INSTALL.vcxproj" on node 1 (default targets).
[        ] Project "C:\working\flutter\ftest\build\windows\INSTALL.vcxproj" (1) is building "C:\working\flutter\ftest\build\windows\ZERO_CHECK.vcxproj" (2) on node 1 (default targets).
[        ] InitializeBuildStatus:
[        ]   Creating "x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
[  +28 ms] CustomBuild:
[        ]   All outputs are up-to-date.
[  +34 ms] FinalizeBuildStatus:
[        ]   Deleting file "x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
[        ]   Touching "x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate".
[        ] Done Building Project "C:\working\flutter\ftest\build\windows\ZERO_CHECK.vcxproj" (default targets).
[  +97 ms] Project "C:\working\flutter\ftest\build\windows\INSTALL.vcxproj" (1) is building "C:\working\flutter\ftest\build\windows\ALL_BUILD.vcxproj" (3) on node 1 (default targets).
[        ] Project "C:\working\flutter\ftest\build\windows\ALL_BUILD.vcxproj" (3) is building "C:\working\flutter\ftest\build\windows\flutter\flutter_wrapper_app.vcxproj" (4) on node 1 (default targets).
[        ] Project "C:\working\flutter\ftest\build\windows\flutter\flutter_wrapper_app.vcxproj" (4) is building "C:\working\flutter\ftest\build\windows\flutter\flutter_assemble.vcxproj" (5) on node 1 (default targets).
[        ] InitializeBuildStatus:
[        ]   Creating "x64\Debug\flutter_assemble\flutter_assemble.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
[   +5 ms] CustomBuild:
[        ]   "The build of 'C:\working\flutter\ftest\build\windows\CMakeFiles\d90235ae74f812ee9eebd44893753f51\flutter_assemble.rule' depends on 'C:\WORKING\FLUTTER\FTEST\WINDOWS\FLUTTER\EPHEMERAL\FLUTTER_WINDOWS.DLL' which is produced by the build of 'C:\working\flutter\ftest\build\windows\CMakeFiles\a30f7fe51d0f1fd68df36c33aa2b6b66\flutter_windows.dll.rule'. The items cannot be built in parallel."
[  +68 ms]   Generating C:/working/flutter/ftest/windows/flutter/ephemeral/flutter_windows.dll, C:/working/flutter/ftest/windows/flutter/ephemeral/flutter_export.h, C:/working/flutter/ftest/windows/flutter/ephemeral/flutter_windows.h, C:/working/flutter/ftest/windows/flutter/ephemeral/flutter_messenger.h, C:/working/flutter/ftest/windows/flutter/ephemeral/flutter_plugin_registrar.h, C:/working/flutter/ftest/windows/flutter/ephemeral/flutter_texture_registrar.h, C:/working/flutter/ftest/windows/flutter/ephemeral/cpp_client_wrapper/core_implementations.cc, C:/working/flutter/ftest/windows/flutter/ephemeral/cpp_client_wrapper/standard_codec.cc, C:/working/flutter/ftest/windows/flutter/ephemeral/cpp_client_wrapper/plugin_registrar.cc, C:/working/flutter/ftest/windows/flutter/ephemeral/cpp_client_wrapper/flutter_engine.cc, C:/working/flutter/ftest/windows/flutter/ephemeral/cpp_client_wrapper/flutter_view_controller.cc, _phony_
[ +983 ms]   [  +63 ms] executing: [c:\working\opensrc\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[  +83 ms]   [ +102 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[        ]   [        ] a4ba62fd9defa3b905eee50f7311fa6561228ea1
[        ]   [        ] executing: [c:\working\opensrc\flutter/] git tag --points-at a4ba62fd9defa3b905eee50f7311fa6561228ea1
[  +92 ms]   [  +91 ms] Exit code 0 from: git tag --points-at a4ba62fd9defa3b905eee50f7311fa6561228ea1
[   +1 ms]   [   +1 ms] executing: [c:\working\opensrc\flutter/] git describe --match *.*.* --long --tags a4ba62fd9defa3b905eee50f7311fa6561228ea1
[ +148 ms]   [ +148 ms] Exit code 0 from: git describe --match *.*.* --long --tags a4ba62fd9defa3b905eee50f7311fa6561228ea1
[        ]   [        ] 3.0.0-0.0.pre-1698-ga4ba62fd9d
[ +303 ms]   [ +303 ms] Unable to locate an Android SDK.
[   +3 ms]   [   +3 ms] executing: [c:\working\opensrc\flutter/] git rev-parse --abbrev-ref HEAD
[  +60 ms]   [  +58 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ]   [        ] master
[  +70 ms]   [  +72 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ]   [        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ]   [        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ]   [        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +3 ms]   [   +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ]   [        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ]   [        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ]   [        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ]   [        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ]   [        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ]   [        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +87 ms]   [  +87 ms] executing: [c:\working\opensrc\flutter/] git rev-parse --abbrev-ref --symbolic @{upstream}
[  +65 ms]   [  +65 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{upstream}
[        ]   [        ] origin/master
[        ]   [        ] executing: [c:\working\opensrc\flutter/] git ls-remote --get-url origin
[  +56 ms]   [  +56 ms] Exit code 0 from: git ls-remote --get-url origin
[        ]   [        ] https://github.com/flutter/flutter.git
[        ]   [        ] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[        ]   [        ] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[        ]   [        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ]   [        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ]   [        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ]   [        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[        ]   [        ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[   +2 ms]   [   +2 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ]   [        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ]   [        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ]   [        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ]   [        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ]   [        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[        ]   [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ]   [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ]   [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ]   [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ]   [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ]   [        ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[        ]   [        ] Artifact Instance of 'PubDependencies' is not required, skipping update.
[  +34 ms]   [  +34 ms] Initializing file store
[  +12 ms]   [  +12 ms] Done initializing file store
[  +34 ms]   [  +34 ms] Skipping target: gen_localizations
[   +8 ms]   [   +8 ms] Skipping target: gen_dart_plugin_registrant
[+3207 ms]   [+3207 ms] Skipping target: unpack_windows
[ +428 ms]   [ +428 ms] Skipping target: kernel_snapshot
[ +225 ms]   [ +225 ms] Skipping target: debug_bundle_windows_assets
[        ]   [        ] Persisting file store
[   +8 ms]   [   +8 ms] Done persisting file store
[   +4 ms]   [   +4 ms] build succeeded.
[   +8 ms]   [   +7 ms] "flutter assemble" took 4,209ms.
[ +192 ms]   [ +192 ms] ensureAnalyticsSent: 188ms
[   +1 ms]   [   +1 ms] Running shutdown hooks
[        ]   [        ] Shutdown hooks complete
[        ]   [        ] exiting with code 0
[  +73 ms] FinalizeBuildStatus:
[        ]   Deleting file "x64\Debug\flutter_assemble\flutter_assemble.tlog\unsuccessfulbuild".
[        ]   Touching "x64\Debug\flutter_assemble\flutter_assemble.tlog\flutter_assemble.lastbuildstate".
[        ] Done Building Project "C:\working\flutter\ftest\build\windows\flutter\flutter_assemble.vcxproj" (default targets).
[  +12 ms] InitializeBuildStatus:
[        ]   Creating "flutter_wrapper_app.dir\Debug\flutter_.8E110688.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
[   +1 ms] CustomBuild:
[        ]   All outputs are up-to-date.
[  +37 ms] ClCompile:
[        ]   All outputs are up-to-date.
[  +18 ms] Lib:
[        ]   All outputs are up-to-date.
[        ]   flutter_wrapper_app.vcxproj -> C:\working\flutter\ftest\build\windows\flutter\Debug\flutter_wrapper_app.lib
[  +16 ms] FinalizeBuildStatus:
[        ]   Deleting file "flutter_wrapper_app.dir\Debug\flutter_.8E110688.tlog\unsuccessfulbuild".
[        ]   Touching "flutter_wrapper_app.dir\Debug\flutter_.8E110688.tlog\flutter_wrapper_app.lastbuildstate".
[        ] Done Building Project "C:\working\flutter\ftest\build\windows\flutter\flutter_wrapper_app.vcxproj" (default targets).
[  +34 ms] Project "C:\working\flutter\ftest\build\windows\ALL_BUILD.vcxproj" (3) is building "C:\working\flutter\ftest\build\windows\flutter\flutter_wrapper_plugin.vcxproj" (6) on node 1 (default targets).
[        ] InitializeBuildStatus:
[        ]   Creating "flutter_wrapper_plugin.dir\Debug\flutter_.7F058E2E.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
[   +1 ms] CustomBuild:
[        ]   All outputs are up-to-date.
[   +8 ms] ClCompile:
[        ]   All outputs are up-to-date.
[   +3 ms] Lib:
[        ]   All outputs are up-to-date.
[        ]   flutter_wrapper_plugin.vcxproj -> C:\working\flutter\ftest\build\windows\flutter\Debug\flutter_wrapper_plugin.lib
[   +6 ms] FinalizeBuildStatus:
[        ]   Deleting file "flutter_wrapper_plugin.dir\Debug\flutter_.7F058E2E.tlog\unsuccessfulbuild".
[        ]   Touching "flutter_wrapper_plugin.dir\Debug\flutter_.7F058E2E.tlog\flutter_wrapper_plugin.lastbuildstate".
[        ] Done Building Project "C:\working\flutter\ftest\build\windows\flutter\flutter_wrapper_plugin.vcxproj" (default targets).
[  +28 ms] Project "C:\working\flutter\ftest\build\windows\ALL_BUILD.vcxproj" (3) is building "C:\working\flutter\ftest\build\windows\runner\ftest.vcxproj" (7) on node 1 (default targets).
[        ] InitializeBuildStatus:
[        ]   Creating "ftest.dir\Debug\ftest.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
[   +1 ms] CustomBuild:
[        ]   All outputs are up-to-date.
[  +28 ms] ClCompile:
[        ]   C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX64\x64\CL.exe /c /IC:\working\flutter\ftest\windows /IC:\working\flutter\ftest\windows\flutter\ephemeral /IC:\working\flutter\ftest\windows\flutter\ephemeral\cpp_client_wrapper\include /Zi /nologo /W4 /WX /diagnostics:column /Od /Ob0 /D WIN32 /D _WINDOWS /D _HAS_EXCEPTIONS=0 /D _DEBUG /D NOMINMAX /D UNICODE /D _UNICODE /D "CMAKE_INTDIR=\"Debug\"" /D _UNICODE /D UNICODE /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /std:c++17 /Fo"ftest.dir\Debug\\" /Fd"ftest.dir\Debug\vc142.pdb" /Gd /TP /wd4100 /errorReport:queue C:\working\flutter\ftest\windows\flutter\generated_plugin_registrant.cc C:\working\flutter\ftest\windows\runner\flutter_window.cpp
[  +84 ms]   generated_plugin_registrant.cc
[ +351 ms]   flutter_window.cpp
[ +815 ms]   Generating Code...
[  +89 ms] ResourceCompile:
[        ]   All outputs are up-to-date.
[  +27 ms] Link:
[        ]   C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX64\x64\link.exe /ERRORREPORT:QUEUE /OUT:"C:\working\flutter\ftest\build\windows\runner\Debug\ftest.exe" /INCREMENTAL /NOLOGO ..\flutter\Debug\flutter_wrapper_app.lib C:\working\flutter\ftest\windows\flutter\ephemeral\flutter_windows.dll.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /manifestinput:C:\working\flutter\ftest\windows\runner\runner.exe.manifest /DEBUG /PDB:"C:/working/flutter/ftest/build/windows/runner/Debug/ftest.pdb" /SUBSYSTEM:WINDOWS /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:/working/flutter/ftest/build/windows/runner/Debug/ftest.lib" /MACHINE:X64  /machine:x64 ftest.dir\Debug\Runner.res
[        ]   ftest.dir\Debug\flutter_window.obj
[        ]   ftest.dir\Debug\main.obj
[        ]   ftest.dir\Debug\utils.obj
[        ]   ftest.dir\Debug\win32_window.obj
[        ]   ftest.dir\Debug\generated_plugin_registrant.obj
[ +192 ms]   ftest.vcxproj -> C:\working\flutter\ftest\build\windows\runner\Debug\ftest.exe
[   +8 ms] FinalizeBuildStatus:
[        ]   Deleting file "ftest.dir\Debug\ftest.tlog\unsuccessfulbuild".
[        ]   Touching "ftest.dir\Debug\ftest.tlog\ftest.lastbuildstate".
[        ] Done Building Project "C:\working\flutter\ftest\build\windows\runner\ftest.vcxproj" (default targets).
[   +7 ms] InitializeBuildStatus:
[        ]   Creating "x64\Debug\ALL_BUILD\ALL_BUILD.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
[   +2 ms] CustomBuild:
[        ]   All outputs are up-to-date.
[   +7 ms] FinalizeBuildStatus:
[        ]   Deleting file "x64\Debug\ALL_BUILD\ALL_BUILD.tlog\unsuccessfulbuild".
[        ]   Touching "x64\Debug\ALL_BUILD\ALL_BUILD.tlog\ALL_BUILD.lastbuildstate".
[        ] Done Building Project "C:\working\flutter\ftest\build\windows\ALL_BUILD.vcxproj" (default targets).
[   +6 ms] InitializeBuildStatus:
[        ]   Creating "x64\Debug\INSTALL\INSTALL.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
[  +61 ms] PostBuildEvent:
[        ]   setlocal
[        ]   "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -DBUILD_TYPE=Debug -P cmake_install.cmake
[        ]   if %errorlevel% neq 0 goto :cmEnd
[        ]   :cmEnd
[        ]   endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
[        ]   :cmErrorLevel
[        ]   exit /b %1
[        ]   :cmDone
[        ]   if %errorlevel% neq 0 goto :VCEnd
[        ]   :VCEnd
[  +62 ms]   -- Install configuration: "Debug"
[  +22 ms]   -- Up-to-date: C:/working/flutter/ftest/build/windows/runner/Debug/data/icudtl.dat
[        ]   -- Up-to-date: C:/working/flutter/ftest/build/windows/runner/Debug/flutter_windows.dll
[   +7 ms]   -- Installing: C:/working/flutter/ftest/build/windows/runner/Debug/data/flutter_assets
[        ]   -- Installing: C:/working/flutter/ftest/build/windows/runner/Debug/data/flutter_assets/AssetManifest.json
[   +1 ms]   -- Installing: C:/working/flutter/ftest/build/windows/runner/Debug/data/flutter_assets/FontManifest.json
[   +2 ms]   -- Installing: C:/working/flutter/ftest/build/windows/runner/Debug/data/flutter_assets/fonts
[        ]   -- Installing: C:/working/flutter/ftest/build/windows/runner/Debug/data/flutter_assets/fonts/MaterialIcons-Regular.otf
[   +6 ms]   -- Installing: C:/working/flutter/ftest/build/windows/runner/Debug/data/flutter_assets/kernel_blob.bin
[  +80 ms]   -- Installing: C:/working/flutter/ftest/build/windows/runner/Debug/data/flutter_assets/NOTICES.Z
[   +2 ms]   -- Installing: C:/working/flutter/ftest/build/windows/runner/Debug/data/flutter_assets/packages
[        ]   -- Installing: C:/working/flutter/ftest/build/windows/runner/Debug/data/flutter_assets/packages/cupertino_icons
[        ]   -- Installing: C:/working/flutter/ftest/build/windows/runner/Debug/data/flutter_assets/packages/cupertino_icons/assets
[   +1 ms]   -- Installing: C:/working/flutter/ftest/build/windows/runner/Debug/data/flutter_assets/packages/cupertino_icons/assets/CupertinoIcons.ttf
[   +2 ms]   -- Installing: C:/working/flutter/ftest/build/windows/runner/Debug/data/flutter_assets/shaders
[   +2 ms]   -- Installing: C:/working/flutter/ftest/build/windows/runner/Debug/data/flutter_assets/shaders/ink_sparkle.frag
[  +13 ms] FinalizeBuildStatus:
[        ]   Deleting file "x64\Debug\INSTALL\INSTALL.tlog\unsuccessfulbuild".
[        ]   Touching "x64\Debug\INSTALL\INSTALL.tlog\INSTALL.lastbuildstate".
[        ] Done Building Project "C:\working\flutter\ftest\build\windows\INSTALL.vcxproj" (default targets).
[   +1 ms] Build succeeded.
[        ]     0 Warning(s)
[        ]     0 Error(s)
[        ] Time Elapsed 00:00:08.79
[  +21 ms] Building Windows application... (completed in 9.3s)
[ +198 ms] Observatory URL on device: http://<IP_ADDRESS>:55905/r-hLJNyAIDs=/
[   +4 ms] Caching compiled dill
[  +26 ms] Connecting to service protocol: http://<IP_ADDRESS>:55905/r-hLJNyAIDs=/
[ +124 ms] Launching a Dart Developer Service (DDS) instance at http://<IP_ADDRESS>:0, connecting to VM service at http://<IP_ADDRESS>:55905/r-hLJNyAIDs=/.
[  +66 ms] DDS is listening at http://<IP_ADDRESS>:55908/fwHTMdQUqs8=/.
[  +52 ms] Successfully connected to service protocol: http://<IP_ADDRESS>:55905/r-hLJNyAIDs=/
[  +16 ms] DevFS: Creating new filesystem on the device (null)
[  +18 ms] DevFS: Created new filesystem on the device (file:///C:/Users/dave/AppData/Local/Temp/ftest526502a6/ftest/)
[   +1 ms] Updating assets
[  +88 ms] Syncing files to device Windows...
[   +2 ms] Compiling dart to kernel with 0 updated files
[        ] Processing bundle.
[   +1 ms] <- recompile package:ftest/main.dart 808453b5-40bb-443d-9d47-1c9ff4ff0734
[        ] <- 808453b5-40bb-443d-9d47-1c9ff4ff0734
[   +1 ms] Bundle processing done.
[        ] flutter: Wrapping focus
[ +100 ms] Updating files.
[        ] DevFS: Sync finished
[   +1 ms] Syncing files to device Windows... (completed in 106ms)
[        ] Synced 0.0MB.
[   +1 ms] <- accept
[   +2 ms] Connected to _flutterView/0x25924f06b20.
[   +2 ms] Flutter run key commands.
[   +1 ms] r Hot reload.
[        ] R Hot restart.
[        ] h List all available interactive commands.
[        ] d Detach (terminate "flutter run" but leave application running).
[        ] c Clear the screen
[        ] q Quit (terminate the application on the device).
[        ]  Running with sound null safety
[        ] An Observatory debugger and profiler on Windows is available at: http://<IP_ADDRESS>:55908/fwHTMdQUqs8=/
[  +30 ms] The Flutter DevTools debugger and profiler on Windows is available at: http://<IP_ADDRESS>:9103?uri=http://<IP_ADDRESS>:55908/fwHTMdQUqs8=/
[+19910 ms] Unable to parse JSON message:
[        ] The document is empty.
[   +9 ms]
           ΓòÉΓòÉΓòí EXCEPTION CAUGHT BY SERVICES LIBRARY Γò₧ΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉ
           The following assertion was thrown during a platform message callback:
           A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this
           occurs in real application, please report this bug to Flutter. If this occurs in unit tests, please
           ensure that simulated events follow Flutter's event model as documented in `HardwareKeyboard`. This
           was the event: KeyRepeatEvent#7968b(physicalKey: PhysicalKeyboardKey#700e0(usbHidUsage:
           "0x000700e0", debugName: "Control Left"), logicalKey: LogicalKeyboardKey#00100(keyId: "0x200000100",
           keyLabel: "Control Left", debugName: "Control Left"), character: null, timeStamp: 50:59:33.427790)
           'package:flutter/src/services/hardware_keyboard.dart':
           Failed assertion: line 432 pos 16: '_pressedKeys.containsKey(event.physicalKey)'

           Either the assertion indicates an error in the framework itself, or we should provide substantially
           more information in this error message to help you determine and fix the underlying cause.
           In either case, please report this assertion by filing a bug on GitHub:
             https://github.com/flutter/flutter/issues/new?template=2_bug.md

           When the exception was thrown, this was the stack:
           #2      HardwareKeyboard._assertEventIsRegular.<anonymous closure> (package:flutter/src/services/hardware_keyboard.dart:432:16)
           #3      HardwareKeyboard._assertEventIsRegular (package:flutter/src/services/hardware_keyboard.dart:443:6)
           #4      HardwareKeyboard.handleKeyEvent (package:flutter/src/services/hardware_keyboard.dart:535:5)
           #5      KeyEventManager.handleRawKeyMessage (package:flutter/src/services/hardware_keyboard.dart:881:37)
           #6      BasicMessageChannel.setMessageHandler.<anonymous closure> (package:flutter/src/services/platform_channel.dart:197:49)
           #7      _DefaultBinaryMessenger.setMessageHandler.<anonymous closure> (package:flutter/src/services/binding.dart:387:35)
           #8      _invoke2 (dart:ui/hooks.dart:186:13)
           #9      _ChannelCallbackRecord.invoke (dart:ui/channel_buffers.dart:42:5)
           #10     _Channel.push (dart:ui/channel_buffers.dart:132:31)
           #11     ChannelBuffers.push (dart:ui/channel_buffers.dart:329:17)
           #12     PlatformDispatcher._dispatchPlatformMessage (dart:ui/platform_dispatcher.dart:599:22)
           #13     _dispatchPlatformMessage (dart:ui/hooks.dart:89:31)
           (elided 2 frames from class _AssertionError)
           ΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉ
[   +4 ms] Unable to parse JSON message:
[        ] The document is empty.
[   +2 ms]
           Another exception was thrown: A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model as documented in `HardwareKeyboard`. This was the event: KeyRepeatEvent#7968b(physicalKey: PhysicalKeyboardKey#700e0(usbHidUsage: "0x000700e0", debugName: "Control Left"), logicalKey: LogicalKeyboardKey#00100(keyId: "0x200000100", keyLabel: "Control Left", debugName: "Control Left"), character: null, timeStamp: 50:59:33.427790)
[  +27 ms] Unable to parse JSON message:
[        ] The document is empty.
[   +1 ms]
           Another exception was thrown: A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model as documented in `HardwareKeyboard`. This was the event: KeyRepeatEvent#7968b(physicalKey: PhysicalKeyboardKey#700e0(usbHidUsage: "0x000700e0", debugName: "Control Left"), logicalKey: LogicalKeyboardKey#00100(keyId: "0x200000100", keyLabel: "Control Left", debugName: "Control Left"), character: null, timeStamp: 50:59:33.427790)
[  +28 ms] Unable to parse JSON message:
[        ] The document is empty.
[   +1 ms]
           Another exception was thrown: A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model as documented in `HardwareKeyboard`. This was the event: KeyRepeatEvent#7968b(physicalKey: PhysicalKeyboardKey#700e0(usbHidUsage: "0x000700e0", debugName: "Control Left"), logicalKey: LogicalKeyboardKey#00100(keyId: "0x200000100", keyLabel: "Control Left", debugName: "Control Left"), character: null, timeStamp: 50:59:33.427790)
[  +29 ms] Unable to parse JSON message:
[        ] The document is empty.
[   +1 ms]
           Another exception was thrown: A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model as documented in `HardwareKeyboard`. This was the event: KeyRepeatEvent#7968b(physicalKey: PhysicalKeyboardKey#700e0(usbHidUsage: "0x000700e0", debugName: "Control Left"), logicalKey: LogicalKeyboardKey#00100(keyId: "0x200000100", keyLabel: "Control Left", debugName: "Control Left"), character: null, timeStamp: 50:59:33.427790)
[  +29 ms] Unable to parse JSON message:
[        ] The document is empty.
[   +1 ms]
           Another exception was thrown: A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model as documented in `HardwareKeyboard`. This was the event: KeyRepeatEvent#7968b(physicalKey: PhysicalKeyboardKey#700e0(usbHidUsage: "0x000700e0", debugName: "Control Left"), logicalKey: LogicalKeyboardKey#00100(keyId: "0x200000100", keyLabel: "Control Left", debugName: "Control Left"), character: null, timeStamp: 50:59:33.427790)
[   +8 ms] Unable to parse JSON message:
[        ] The document is empty.
[   +1 ms]
           Another exception was thrown: A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model as documented in `HardwareKeyboard`. This was the event: KeyRepeatEvent#7968b(physicalKey: PhysicalKeyboardKey#700e0(usbHidUsage: "0x000700e0", debugName: "Control Left"), logicalKey: LogicalKeyboardKey#00100(keyId: "0x200000100", keyLabel: "Control Left", debugName: "Control Left"), character: null, timeStamp: 50:59:33.427790)

PS C:\working\flutter\ftest> flutter analyze
Analyzing ftest...

   info - The import of 'package:flutter/rendering.dart' is unnecessary because all of the used elements are also
          provided by the import of 'package:flutter/material.dart' - lib\main.dart:2:8 - unnecessary_import
   info - Prefer const with constant constructors - lib\main.dart:15:12 - prefer_const_constructors
   info - Unnecessary new keyword - lib\main.dart:36:27 - unnecessary_new
   info - Avoid `print` calls in production code - lib\main.dart:39:5 - avoid_print
   info - Avoid `print` calls in production code - lib\main.dart:43:11 - avoid_print
   info - Avoid `print` calls in production code - lib\main.dart:61:19 - avoid_print
   info - Avoid unnecessary containers - lib\main.dart:65:18 - avoid_unnecessary_containers
   info - Prefer const with constant constructors - lib\main.dart:101:14 - prefer_const_constructors

8 issues found. (ran in 2.1s)
PS C:\working\flutter\ftest>

PS C:\working\flutter\ftest> flutter doctor -v
[√] Flutter (Channel master, 3.1.0-0.0.pre.1698, on Microsoft Windows [Version 10.0.19044.1826], locale en-GB)
    • Flutter version 3.1.0-0.0.pre.1698 on channel master at c:\working\opensrc\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision a4ba62fd9d (3 days ago), 2022-07-17 05:48:06 -0400
    • Engine revision b438edfd1a
    • Dart version 2.19.0 (build 2.19.0-5.0.dev)
    • DevTools version 2.15.0

[X] Android toolchain - develop for Android devices
    X Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.8.1)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.8.30711.63
    • Windows 10 SDK version 10.0.18362.0

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).

[√] IntelliJ IDEA Community Edition (version 2020.2)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.2.4
    • Flutter plugin version 57.0.2
    • Dart plugin version 202.8488

[√] VS Code (version 1.57.1)
    • VS Code at C:\Users\dave\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.23.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19044.1826]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 103.0.5060.134
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 97.0.1072.62

[√] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 2 categories.
PS C:\working\flutter\ftest>

I see you are running on a Mac, I am running on Windows.
It seems to happen very reliably, and I just ran a flutter upgrade and the problem still happens
(Upgrading Flutter to 3.1.0-0.0.pre.1784 from 3.1.0-0.0.pre.1698 in c:\working\opensrc\flutter...)
Are you (or someone else) able to try this on a Windows 10 machine?
Thanks,
David.

@scaphe I did verify on windows, I accidentally shared the flutter doctor output of mac (Edited it). Please see the logs in my previous comment.
Does this issue occur with a newly created flutter counter app? Also is your device using any other locale other than English?

Hi sorry, saw the word mac and just assumed.
So, just tried:

flutter create fblank
cd fblank
flutter run
click on the counter
hold left ctrl key
move mouse
get errors

I've rebooted today in case that helps, it didn't.
I'm using a Dell XPS 15 7590 laptop using Windows 10 Home, 10.0.19044 Build 19044.
It happens with external mouse or nothing plugged in and using the trackpad.
Locale is English (UK), keyboard is uk (I think).
Is there some kind of extra debug options I could run with?

Thanks those steps are really helpful. But unfortunately, I am unable to reproduce it on my machine. Labeling for further investigation from the team.
Is there some kind of extra debug options I could run with?
You could try running flutter run -v to get a verbose log output

cc: @dkwingsmt

nothing new is logger with the -v option.

Has anyone else tried to repro this on windows yet?

I can reproduce it.
Like you said:

flutter create fblank
cd fblank
flutter run

It happens when I ctrl-click anywhere but hold ctrl a little longer than in a fast ctrl-click.
══╡ EXCEPTION CAUGHT BY SERVICES LIBRARY ╞══════════════════════════════════════════════════════════
The following assertion was thrown during a platform message callback:
A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this
occurs in real application, please report this bug to Flutter. If this occurs in unit tests, please
ensure that simulated events follow Flutter's event model as documented in HardwareKeyboard. This
was the event: KeyRepeatEvent#c6651(physicalKey: PhysicalKeyboardKey#700e4(usbHidUsage:
"0x000700e4", debugName: "Control Right"), logicalKey: LogicalKeyboardKey#00101(keyId:
"0x200000101", keyLabel: "Control Right", debugName: "Control Right"), character: null, timeStamp:
11:55:35.893688)
'package:flutter/src/services/hardware_keyboard.dart':
Failed assertion: line 432 pos 16: '_pressedKeys.containsKey(event.physicalKey)'
Either the assertion indicates an error in the framework itself, or we should provide substantially
more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=2_bug.md
When the exception was thrown, this was the stack:
#2      HardwareKeyboard._assertEventIsRegular.<anonymous closure>
(package:flutter/src/services/hardware_keyboard.dart:432:16)
#3      HardwareKeyboard._assertEventIsRegular (package:flutter/src/services/hardware_keyboard.dart:443:6)
#4      HardwareKeyboard.handleKeyEvent (package:flutter/src/services/hardware_keyboard.dart:535:5)
#5      KeyEventManager.handleRawKeyMessage (package:flutter/src/services/hardware_keyboard.dart:881:37)
#6      BasicMessageChannel.setMessageHandler.<anonymous closure>
(package:flutter/src/services/platform_channel.dart:197:49)
#7      _DefaultBinaryMessenger.setMessageHandler.<anonymous closure> (package:flutter/src/services/binding.dart:387:35)
#8      _invoke2 (dart:ui/hooks.dart:186:13)
#9      _ChannelCallbackRecord.invoke (dart:ui/channel_buffers.dart:42:5)
#10     _Channel.push (dart:ui/channel_buffers.dart:132:31)
#11     ChannelBuffers.push (dart:ui/channel_buffers.dart:329:17)
#12     PlatformDispatcher._dispatchPlatformMessage (dart:ui/platform_dispatcher.dart:599:22)
#13     _dispatchPlatformMessage (dart:ui/hooks.dart:89:31)
(elided 2 frames from class _AssertionError)
════════════════════════════════════════════════════════════════════════════════════════════════════

And then on any key i press:
Another exception was thrown: A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed.
If this occurs in real application, please report this bug to Flutter. If this occurs in unit tests, please ensure that
simulated events follow Flutter's event model as documented in `HardwareKeyboard`. This was the event:
KeyRepeatEvent#c6651(physicalKey: PhysicalKeyboardKey#700e4(usbHidUsage: "0x000700e4", debugName: "Control Right"),
logicalKey: LogicalKeyboardKey#00101(keyId: "0x200000101", keyLabel: "Control Right", debugName: "Control Right"),
character: null, timeStamp: 11:55:35.893688)
Unable to parse JSON message:
The document is empty.

Thinkpad T470p
Flutter (Channel stable, 3.3.0, on Microsoft Windows [Version 10.0.19044.1889], locale de-DE)

Happens to me too. Any keyboard key starts causing this exception after i click a modifier key (tested on ctrl, shift, alt keys).
OS: Windows 11
The issue was not happening on flutter 2.10.0, then a updated the version to 3.3.0 and the problem started to happen.
I also updated platform code with flutter create --platforms=windows,macos,linux . command to make sure that it is note connected to the platform code of the older flutter version.
For my application https://github.com/kennelken/gceditor_fl the issue happens in Debug mode (vscode connected), but does not seem to happen in a Release build.
[√] Flutter (Channel stable, 3.3.0, on Microsoft Windows [Version 10.0.22000.856], locale en-US)
    • Flutter version 3.3.0 on channel stable at C:\tools\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ffccd96b62 (4 days ago), 2022-08-29 17:28:57 -0700
    • Engine revision 5e9e0e0aa8
    • Dart version 2.18.0
    • DevTools version 2.15.0

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at C:\Users\serge\AppData\Local\Android\sdk
    • Platform android-31, build-tools 30.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.2)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.11.31624.102
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 4.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code, 64-bit edition (version 1.71.0)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 3.48.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22000.856]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 104.0.5112.102
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 104.0.1293.70

[√] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

Exception:
flutter: LogLevel.error: error: 'package:flutter/src/services/hardware_keyboard.dart': Failed assertion: line 432 pos 16: '_pressedKeys.containsKey(event.physicalKey)': A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model as documented in `HardwareKeyboard`. This was the event: KeyRepeatEvent#d92dd(physicalKey: PhysicalKeyboardKey#700e4(usbHidUsage: "0x000700e4", debugName: "Control Right"), logicalKey: LogicalKeyboardKey#00101(keyId: "0x200000101", keyLabel: "Control Right", debugName: "Control Right"), character: null, timeStamp: 15:32:47.521520)
stacktrace: #0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61)
#1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5)
#2      HardwareKeyboard._assertEventIsRegular.<anonymous closure> (package:flutter/src/services/hardware_keyboard.dart:432:16)
#3      HardwareKeyboard._assertEventIsRegular (package:flutter/src/services/hardware_keyboard.dart:443:6)
#4      HardwareKeyboard.handleKeyEvent (package:flutter/src/services/hardware_keyboard.dart:535:5)
#5      KeyEventManager.handleRawKeyMessage (package:flutter/src/services/hardware_keyboard.dart:881:37)
#6      BasicMessageChannel.setMessageHandler.<anonymous closure> (package:flutter/src/services/platform_channel.dart:197:49)
#7      _DefaultBinaryMessenger.setMessageHandler.<anonymous closure> (package:flutter/src/services/binding.dart:387:35)
#8      _invoke2 (dart:ui/hooks.dart:186:13)
#9      _ChannelCallbackRecord.invoke (dart:ui/channel_buffers.dart:42:5)
#10     _Channel.push (dart:ui/channel_buffers.dart:132:31)
#11     ChannelBuffers.push (dart:ui/channel_buffers.dart:329:17)
#12     PlatformDispatcher._dispatchPlatformMessage (dart:ui/platform_dispatcher.dart:599:22)
#13     _dispatchPlatformMessage (dart:ui/hooks.dart:89:31)
flutter: [2022-09-03 13:36:23.716734 | Catcher | INFO] Report result: true
Unable to parse JSON message:flutter: [2022-09-03 13:36:23.762640 | Catcher | FINE] Error: ''package:flutter/src/services/hardware_keyboard.dart': Failed assertion: line 432 pos 16: '_pressedKeys.containsKey(event.physicalKey)': A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model as documented in `HardwareKeyboard`. This was the event: KeyRepeatEvent#d92dd(physicalKey: PhysicalKeyboardKey#700e4(usbHidUsage: "0x000700e4", debugName: "Control Right"), logicalKey: LogicalKeyboardKey#00101(keyId: "0x200000101", keyLabel: "Control Right", debugName: "Control Right"), character: null, timeStamp: 15:32:47.521520)' has been skipped to due to duplication occurence within 3000 ms.

I don't know whether it is connected, but every time this exception happens thee are suspicious messages in a log:
Unable to parse JSON message:
The document is empty.

Same here. Windows 11, VSCode, when debugging. After the error, some keys, like backspace and delete, stop working.
Launching lib\main.dart on Windows in debug mode...
Connecting to VM Service at ws://<IP_ADDRESS>:57056/PymCP6TFVaY=/ws
Unable to parse JSON message:
The document is empty.
════════ Exception caught by services library ══════════════════════════════════
The following assertion was thrown during a platform message callback:
A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model as documented in HardwareKeyboard. This was the event: KeyRepeatEvent#9c01f(physicalKey: PhysicalKeyboardKey#700e0(usbHidUsage: "0x000700e0", debugName: "Control Left"), logicalKey: LogicalKeyboardKey#00100(keyId: "0x200000100", keyLabel: "Control Left", debugName: "Control Left"), character: null, timeStamp: 215:59:02.634943)
'package:flutter/src/services/hardware_keyboard.dart':
Failed assertion: line 432 pos 16: '_pressedKeys.containsKey(event.physicalKey)'
[✓] Flutter (Channel stable, 3.3.0, on Microsoft Windows [Version 10.0.22000.918], locale pt-BR)
• Flutter version 3.3.0 on channel stable at C:\Tools\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision ffccd96b62 (8 days ago), 2022-08-29 17:28:57 -0700
• Engine revision 5e9e0e0aa8
• Dart version 2.18.0
• DevTools version 2.15.0
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
• Android SDK at C:\Users\slarg\AppData\Local\Android\Sdk
• Platform android-32, build-tools 32.1.0-rc1
• ANDROID_SDK_ROOT = C:\Users\slarg\AppData\Local\Android\Sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[✓] Visual Studio - develop for Windows (Visual Studio Community 2022 17.3.3)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.3.32825.248
• Windows 10 SDK version 10.0.19041.0
[✓] Android Studio (version 2021.1)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)
[✓] Connected device (3 available)
• Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22000.918]
• Chrome (web)      • chrome  • web-javascript • Google Chrome 105.0.5195.102
• Edge (web)        • edge    • web-javascript • Microsoft Edge 104.0.1293.47
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!

Also the same here. Just run the following sample code in debug mode, then hold down the Control key for a few seconds, and that exception will occur.
env: Windows 11, VSCode.
void main() {
  runApp(const MainApp());
}

class MainApp extends StatelessWidget {
  const MainApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'Main App',
      home: MainHomePage(),
    );
  }
}

class MainHomePage extends StatelessWidget {
  const MainHomePage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Bar')),
      body: const Center(child: Text('Hello this is main file.')),
    );
  }
}

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.3.1, on Microsoft Windows [Version 10.0.22000.856], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.3.3)
[√] Android Studio (version 2021.1)
[√] IntelliJ IDEA Community Edition (version 2022.2)
[√] VS Code (version 1.71.0)
[√] Connected device (3 available)
[√] HTTP Host Availability

• No issues found!

Exception
Unable to parse JSON message:
The document is empty.
Unable to parse JSON message:
The document is empty.

════════ Exception caught by services library ══════════════════════════════════
The following assertion was thrown during a platform message callback:
A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model as documented in `HardwareKeyboard`. This was the event: KeyRepeatEvent#97f11(physicalKey: PhysicalKeyboardKey#700e0(usbHidUsage: "0x000700e0", debugName: "Control Left"), logicalKey: LogicalKeyboardKey#00100(keyId: "0x200000100", keyLabel: "Control Left", debugName: "Control Left"), character: null, timeStamp: 23:13:22.501630)
'package:flutter/src/services/hardware_keyboard.dart':
package:flutter/…/services/hardware_keyboard.dart:1
Failed assertion: line 432 pos 16: '_pressedKeys.containsKey(event.physicalKey)'

Thanks those steps are really helpful. But unfortunately, I am unable to reproduce it on my machine. Labeling for further investigation from the team.
Is there some kind of extra debug options I could run with?
You could try running flutter run -v to get a verbose log output

pressing alt or other modifier key or UNREGISTERED KEY COMBOs (ctrl, shift, ctrl+shift+space, etc) several seconds, no matter it's reloading or somewhat else, causes exceptions as well:
======== Exception caught by services library ======================================================
The following assertion was thrown during a platform message callback:
A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model as documented in `HardwareKeyboard`. This was the event: KeyRepeatEvent#8b4e8(physicalKey: PhysicalKeyboardKey#700e2(usbHidUsage: "0x000700e2", debugName: "Alt Left"), logicalKey: LogicalKeyboardKey#00104(keyId: "0x200000104", keyLabel: "Alt Left", debugName: "Alt Left"), character: null, timeStamp: 48:27:23.672463)
'package:flutter/src/services/hardware_keyboard.dart':
Failed assertion: line 432 pos 16: '_pressedKeys.containsKey(event.physicalKey)'

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.md

When the exception was thrown, this was the stack:
#2      HardwareKeyboard._assertEventIsRegular.<anonymous closure> (package:flutter/src/services/hardware_keyboard.dart:432:16)
#3      HardwareKeyboard._assertEventIsRegular (package:flutter/src/services/hardware_keyboard.dart:443:6)
#4      HardwareKeyboard.handleKeyEvent (package:flutter/src/services/hardware_keyboard.dart:535:5)
#5      KeyEventManager.handleRawKeyMessage (package:flutter/src/services/hardware_keyboard.dart:881:37)
#6      BasicMessageChannel.setMessageHandler.<anonymous closure> (package:flutter/src/services/platform_channel.dart:197:49)
#7      _DefaultBinaryMessenger.setMessageHandler.<anonymous closure> (package:flutter/src/services/binding.dart:387:35)
#8      _invoke2 (dart:ui/hooks.dart:186:13)
#9      _ChannelCallbackRecord.invoke (dart:ui/channel_buffers.dart:42:5)
#10     _Channel.push (dart:ui/channel_buffers.dart:132:31)
#11     ChannelBuffers.push (dart:ui/channel_buffers.dart:329:17)
#12     PlatformDispatcher._dispatchPlatformMessage (dart:ui/platform_dispatcher.dart:599:22)
#13     _dispatchPlatformMessage (dart:ui/hooks.dart:89:31)
(elided 2 frames from class _AssertionError)
====================================================================================================

https://user-images.githubusercontent.com/41184947/189153821-489afa88-af4c-4383-8f8d-aef747738069.mp4

In my case, downgrade to flutter v3.0.0 it issue

I can consistently reproduce this over a Windows 11 laptop with flutter 3.3.2.
If I use flutter 3.0.5, the issues don't appear, as @Khamphay mentions.

I've just tested this in the beta channel (Flutter 3.4.0-17.2.pre • channel beta at the time of writing) and it appears that this has been fixed. potentially this PR maybe? https://github.com/flutter/engine/pull/36129

Still seing this on flutter 3.3.3 running on Windows 11. Any updates?

this thing is only getting worse

Does any one find out solution over this (Multiple Keyset press together)?

I can confirm, after upgrading to Flutter 3.4.0-34.1.pre the issue is gone.

@maheshmnj
I can confirm that the problem occurs in 'Flutter 3.3.6' on Windows 10/11, for the problem to occur, just press the (Alt) key in a text field, and from there, the problem does not stop, unless restarting the application .
flutter: -- LoginModule INITIALIZED
Unable to parse JSON message:
The document is empty.

══╡ EXCEPTION CAUGHT BY SERVICES LIBRARY ╞══════════════════════════════════════════════════════════
The following assertion was thrown during a platform message callback:
A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this
occurs in real application, please report this bug to Flutter. If this occurs in unit tests, please
ensure that simulated events follow Flutter's event model as documented in `HardwareKeyboard`. This
was the event: KeyRepeatEvent#fa1ab(physicalKey: PhysicalKeyboardKey#700e1(usbHidUsage:
"0x000700e1", debugName: "Shift Left"), logicalKey: LogicalKeyboardKey#00102(keyId: "0x200000102",
keyLabel: "Shift Left", debugName: "Shift Left"), character: null, timeStamp: 5:57:33.030388)
'package:flutter/src/services/hardware_keyboard.dart':
Failed assertion: line 432 pos 16: '_pressedKeys.containsKey(event.physicalKey)'

Either the assertion indicates an error in the framework itself, or we should provide substantially
more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.md

When the exception was thrown, this was the stack:
#2      HardwareKeyboard._assertEventIsRegular.<anonymous closure> (package:flutter/src/services/hardware_keyboard.dart:432:16)
#3      HardwareKeyboard._assertEventIsRegular (package:flutter/src/services/hardware_keyboard.dart:443:6)
#4      HardwareKeyboard.handleKeyEvent (package:flutter/src/services/hardware_keyboard.dart:535:5)
#5      KeyEventManager.handleRawKeyMessage (package:flutter/src/services/hardware_keyboard.dart:881:37)
#6      BasicMessageChannel.setMessageHandler.<anonymous closure> (package:flutter/src/services/platform_channel.dart:197:49)
#7      _DefaultBinaryMessenger.setMessageHandler.<anonymous closure> (package:flutter/src/services/binding.dart:387:35)
#8      _invoke2 (dart:ui/hooks.dart:186:13)
#9      _ChannelCallbackRecord.invoke (dart:ui/channel_buffers.dart:42:5)
#10     _Channel.push (dart:ui/channel_buffers.dart:132:31)
#11     ChannelBuffers.push (dart:ui/channel_buffers.dart:329:17)
#12     PlatformDispatcher._dispatchPlatformMessage (dart:ui/platform_dispatcher.dart:599:22)
#13     _dispatchPlatformMessage (dart:ui/hooks.dart:89:31)
(elided 2 frames from class _AssertionError)
════════════════════════════════════════════════════════════════════════════════════════════════════
Unable to parse JSON message:
The document is empty.

Another exception was thrown: A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real
application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model
as documented in `HardwareKeyboard`. This was the event: KeyRepeatEvent#fa1ab(physicalKey: PhysicalKeyboardKey#700e1(usbHidUsage: "0x000700e1",
debugName: "Shift Left"), logicalKey: LogicalKeyboardKey#00102(keyId: "0x200000102", keyLabel: "Shift Left", debugName: "Shift Left"),
character: null, timeStamp: 5:57:33.030388)
Unable to parse JSON message:
The document is empty.

Another exception was thrown: A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real
application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model
as documented in `HardwareKeyboard`. This was the event: KeyRepeatEvent#fa1ab(physicalKey: PhysicalKeyboardKey#700e1(usbHidUsage: "0x000700e1",
debugName: "Shift Left"), logicalKey: LogicalKeyboardKey#00102(keyId: "0x200000102", keyLabel: "Shift Left", debugName: "Shift Left"),
character: null, timeStamp: 5:57:33.030388)
Unable to parse JSON message:
The document is empty.

Another exception was thrown: A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real
application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model
as documented in `HardwareKeyboard`. This was the event: KeyRepeatEvent#fa1ab(physicalKey: PhysicalKeyboardKey#700e1(usbHidUsage: "0x000700e1",
debugName: "Shift Left"), logicalKey: LogicalKeyboardKey#00102(keyId: "0x200000102", keyLabel: "Shift Left", debugName: "Shift Left"),
character: null, timeStamp: 5:57:33.030388)
Unable to parse JSON message:
The document is empty.

Another exception was thrown: A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real
application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model
as documented in `HardwareKeyboard`. This was the event: KeyRepeatEvent#fa1ab(physicalKey: PhysicalKeyboardKey#700e1(usbHidUsage: "0x000700e1",
debugName: "Shift Left"), logicalKey: LogicalKeyboardKey#00102(keyId: "0x200000102", keyLabel: "Shift Left", debugName: "Shift Left"),
character: null, timeStamp: 5:57:33.030388)
Unable to parse JSON message:
The document is empty.

Another exception was thrown: A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real
application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model
as documented in `HardwareKeyboard`. This was the event: KeyRepeatEvent#fa1ab(physicalKey: PhysicalKeyboardKey#700e1(usbHidUsage: "0x000700e1",
debugName: "Shift Left"), logicalKey: LogicalKeyboardKey#00102(keyId: "0x200000102", keyLabel: "Shift Left", debugName: "Shift Left"),
character: null, timeStamp: 5:57:33.030388)
Unable to parse JSON message:
The document is empty.

Another exception was thrown: A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real
application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model
as documented in `HardwareKeyboard`. This was the event: KeyRepeatEvent#fa1ab(physicalKey: PhysicalKeyboardKey#700e1(usbHidUsage: "0x000700e1",
debugName: "Shift Left"), logicalKey: LogicalKeyboardKey#00102(keyId: "0x200000102", keyLabel: "Shift Left", debugName: "Shift Left"),
character: null, timeStamp: 5:57:33.030388)
Unable to parse JSON message:
The document is empty.

Another exception was thrown: A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real
application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model
as documented in `HardwareKeyboard`. This was the event: KeyRepeatEvent#fa1ab(physicalKey: PhysicalKeyboardKey#700e1(usbHidUsage: "0x000700e1",
debugName: "Shift Left"), logicalKey: LogicalKeyboardKey#00102(keyId: "0x200000102", keyLabel: "Shift Left", debugName: "Shift Left"),
character: null, timeStamp: 5:57:33.030388)
Unable to parse JSON message:
The document is empty.

Another exception was thrown: A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real
application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model
as documented in `HardwareKeyboard`. This was the event: KeyRepeatEvent#fa1ab(physicalKey: PhysicalKeyboardKey#700e1(usbHidUsage: "0x000700e1",
debugName: "Shift Left"), logicalKey: LogicalKeyboardKey#00102(keyId: "0x200000102", keyLabel: "Shift Left", debugName: "Shift Left"),
character: null, timeStamp: 5:57:33.030388)
Unable to parse JSON message:
The document is empty.

Another exception was thrown: A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real
application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model
as documented in `HardwareKeyboard`. This was the event: KeyRepeatEvent#fa1ab(physicalKey: PhysicalKeyboardKey#700e1(usbHidUsage: "0x000700e1",
debugName: "Shift Left"), logicalKey: LogicalKeyboardKey#00102(keyId: "0x200000102", keyLabel: "Shift Left", debugName: "Shift Left"),
character: null, timeStamp: 5:57:33.030388)
flutter: -- LoginModule DISPOSED
flutter: -- LoginModule INITIALIZED
Unable to parse JSON message:
The document is empty.

Another exception was thrown: A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real
application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model
as documented in `HardwareKeyboard`. This was the event: KeyRepeatEvent#fa1ab(physicalKey: PhysicalKeyboardKey#700e1(usbHidUsage: "0x000700e1",
debugName: "Shift Left"), logicalKey: LogicalKeyboardKey#00102(keyId: "0x200000102", keyLabel: "Shift Left", debugName: "Shift Left"),
character: null, timeStamp: 5:57:33.030388)
Unable to parse JSON message:
The document is empty.

Another exception was thrown: A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real
application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model
as documented in `HardwareKeyboard`. This was the event: KeyRepeatEvent#fa1ab(physicalKey: PhysicalKeyboardKey#700e1(usbHidUsage: "0x000700e1",
debugName: "Shift Left"), logicalKey: LogicalKeyboardKey#00102(keyId: "0x200000102", keyLabel: "Shift Left", debugName: "Shift Left"),
character: null, timeStamp: 5:57:33.030388)
Unable to parse JSON message:
The document is empty.

Another exception was thrown: A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real
application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model
as documented in `HardwareKeyboard`. This was the event: KeyRepeatEvent#fa1ab(physicalKey: PhysicalKeyboardKey#700e1(usbHidUsage: "0x000700e1",
debugName: "Shift Left"), logicalKey: LogicalKeyboardKey#00102(keyId: "0x200000102", keyLabel: "Shift Left", debugName: "Shift Left"),
character: null, timeStamp: 5:57:33.030388)
Unable to parse JSON message:
The document is empty.

Another exception was thrown: A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real
application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model
as documented in `HardwareKeyboard`. This was the event: KeyRepeatEvent#fa1ab(physicalKey: PhysicalKeyboardKey#700e1(usbHidUsage: "0x000700e1",
debugName: "Shift Left"), logicalKey: LogicalKeyboardKey#00102(keyId: "0x200000102", keyLabel: "Shift Left", debugName: "Shift Left"),
character: null, timeStamp: 5:57:33.030388)
Unable to parse JSON message:
The document is empty.

Another exception was thrown: A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real
application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model
as documented in `HardwareKeyboard`. This was the event: KeyRepeatEvent#fa1ab(physicalKey: PhysicalKeyboardKey#700e1(usbHidUsage: "0x000700e1",
debugName: "Shift Left"), logicalKey: LogicalKeyboardKey#00102(keyId: "0x200000102", keyLabel: "Shift Left", debugName: "Shift Left"),
character: null, timeStamp: 5:57:33.030388)
Unable to parse JSON message:
The document is empty.

Another exception was thrown: A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real
application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model
as documented in `HardwareKeyboard`. This was the event: KeyRepeatEvent#fa1ab(physicalKey: PhysicalKeyboardKey#700e1(usbHidUsage: "0x000700e1",
debugName: "Shift Left"), logicalKey: LogicalKeyboardKey#00102(keyId: "0x200000102", keyLabel: "Shift Left", debugName: "Shift Left"),
character: null, timeStamp: 5:57:33.030388)
Unable to parse JSON message:
The document is empty.

Another exception was thrown: A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real
application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model
as documented in `HardwareKeyboard`. This was the event: KeyRepeatEvent#fa1ab(physicalKey: PhysicalKeyboardKey#700e1(usbHidUsage: "0x000700e1",
debugName: "Shift Left"), logicalKey: LogicalKeyboardKey#00102(keyId: "0x200000102", keyLabel: "Shift Left", debugName: "Shift Left"),
character: null, timeStamp: 5:57:33.030388)
Unable to parse JSON message:
The document is empty.

Another exception was thrown: A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real
application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model
as documented in `HardwareKeyboard`. This was the event: KeyRepeatEvent#fa1ab(physicalKey: PhysicalKeyboardKey#700e1(usbHidUsage: "0x000700e1",
debugName: "Shift Left"), logicalKey: LogicalKeyboardKey#00102(keyId: "0x200000102", keyLabel: "Shift Left", debugName: "Shift Left"),
character: null, timeStamp: 5:57:33.030388)
Unable to parse JSON message:
The document is empty.

Another exception was thrown: A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real
application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model
as documented in `HardwareKeyboard`. This was the event: KeyRepeatEvent#fa1ab(physicalKey: PhysicalKeyboardKey#700e1(usbHidUsage: "0x000700e1",
debugName: "Shift Left"), logicalKey: LogicalKeyboardKey#00102(keyId: "0x200000102", keyLabel: "Shift Left", debugName: "Shift Left"),
character: null, timeStamp: 5:57:33.030388)
Unable to parse JSON message:
The document is empty.

Another exception was thrown: A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real
application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model
as documented in `HardwareKeyboard`. This was the event: KeyRepeatEvent#fa1ab(physicalKey: PhysicalKeyboardKey#700e1(usbHidUsage: "0x000700e1",
debugName: "Shift Left"), logicalKey: LogicalKeyboardKey#00102(keyId: "0x200000102", keyLabel: "Shift Left", debugName: "Shift Left"),
character: null, timeStamp: 5:57:33.030388)

PS C:\MyDartProjects\riodasostras\riodasostrasapp_mob> flutter --version
Flutter 3.3.6 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 6928314d50 (25 hours ago) • 2022-10-25 16:34:41 -0400
Engine • revision 3ad69d7be3
Tools • Dart 2.18.2 • DevTools 2.15.0

the problem does not happen in "Flutter 3.5.0-10.0.pre.121" and "Flutter 3.4.0-34.1.pre" Windows 11
PS C:\MyDartProjects\riodasostras\riodasostrasapp_mob> flutter doctor -v
[√] Flutter (Channel master, 3.5.0-10.0.pre.121, on Microsoft Windows [versÆo 10.0.22000.1098], locale pt-BR)
    • Flutter version 3.5.0-10.0.pre.121 on channel master at C:\src\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 156c313219 (17 hours ago), 2022-10-26 22:24:14 +0200
    • Engine revision 31d21cbed7
    • Dart version 2.19.0 (build 2.19.0-340.0.dev)
    • DevTools version 2.18.0

[X] Windows Version (Unable to confirm if installed Windows version is 10 or greater)

[√] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
    • Android SDK at C:\Users\isaque\AppData\Local\Android\sdk
    • Platform android-32, build-tools 32.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.3)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.11.31702.278
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2021.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[√] VS Code (version 1.72.2)
    • VS Code at C:\Users\isaque\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.50.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [versÆo 10.0.22000.1098]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 106.0.5249.119
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 105.0.1343.53

[√] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.
PS C:\MyDartProjects\riodasostras\riodasostrasapp_mob>

cc: @dkwingsmt

i have the same problem in flutter 3.4.5

Its been happening to me, though if I do a release build viz. flutter build windows --release, it doesn't happen in the resulting exe.  Even with 3.3.6.

i have the same problem in flutter latest version

Still present on latest stable version (flutter 3.3.7) with Windows 10 21H2. (IntelliJ Idea in Debug mode)

Flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.3.7, on Microsoft Windows [version 10.0.19044.2130], locale fr-CH)
[X] Android toolchain - develop for Android devices
    X Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[√] Visual Studio - develop for Windows (Visual Studio Professional 2019 16.11.20)
[!] Android Studio (not installed)
[√] IntelliJ IDEA Ultimate Edition (version 2022.2)
[√] Connected device (2 available)
[√] HTTP Host Availability

! Doctor found issues in 3 categories.

Stacktrace
======== Exception caught by services library ======================================================
The following assertion was thrown during a platform message callback:
A KeyRepeatEvent is dispatched, but the state shows that the physical key is not pressed. If this occurs in real application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model as documented in `HardwareKeyboard`. This was the event: KeyRepeatEvent#42f08(physicalKey: PhysicalKeyboardKey#700e0(usbHidUsage: "0x000700e0", debugName: "Control Left"), logicalKey: LogicalKeyboardKey#00100(keyId: "0x200000100", keyLabel: "Control Left", debugName: "Control Left"), character: null, timeStamp: 193:50:06.109849)
'package:flutter/src/services/hardware_keyboard.dart':
Failed assertion: line 432 pos 16: '_pressedKeys.containsKey(event.physicalKey)'

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.md

When the exception was thrown, this was the stack:
#2      HardwareKeyboard._assertEventIsRegular.<anonymous closure> (package:flutter/src/services/hardware_keyboard.dart:432:16)
#3      HardwareKeyboard._assertEventIsRegular (package:flutter/src/services/hardware_keyboard.dart:443:6)
#4      HardwareKeyboard.handleKeyEvent (package:flutter/src/services/hardware_keyboard.dart:535:5)
#5      KeyEventManager.handleRawKeyMessage (package:flutter/src/services/hardware_keyboard.dart:881:37)
#6      BasicMessageChannel.setMessageHandler.<anonymous closure> (package:flutter/src/services/platform_channel.dart:197:49)
#7      _DefaultBinaryMessenger.setMessageHandler.<anonymous closure> (package:flutter/src/services/binding.dart:387:35)
#8      _invoke2 (dart:ui/hooks.dart:186:13)
#9      _ChannelCallbackRecord.invoke (dart:ui/channel_buffers.dart:42:5)
#10     _Channel.push (dart:ui/channel_buffers.dart:132:31)
#11     ChannelBuffers.push (dart:ui/channel_buffers.dart:329:17)
#12     PlatformDispatcher._dispatchPlatformMessage (dart:ui/platform_dispatcher.dart:599:22)
#13     _dispatchPlatformMessage (dart:ui/hooks.dart:89:31)
(elided 2 frames from class _AssertionError)
====================================================================================================
Unable to parse JSON message:
The document is empty.

I have exactly the same issue. It's not occur every time, but often. My environment is Windows 11 desktop, Visual Studio Code, flutter 3.3.8

Me too....
operating system is windows 11,
the flutter version is 3.3.8 stable
It throws an exception when I long press with 'ctrl' 'Caps Lock' 'Shift' 'Alt' keys.

Same here, just create

AlertDialog
2 TextFormField
Enter one uppercase letter
keep Shift pressed

Observe any text-field deletion getting broken until app restarting and a massive log spam.
Flutter (Channel stable, 3.3.8, on Microsoft Windows [Version
    10.0.19045.2251], locale de-DE)

Full demo with input attached
https://user-images.githubusercontent.com/1280209/202175400-68c68e4d-3936-41e2-8c48-36806357a22b.mp4

Same problem in 3.3.8

Same problem in 3.3.6. I try to press ctrl + v.

Same porblem
Flutter Channel stable, 3.3.8, on Microsoft Windows

Same porblem
Flutter Channel stable, 3.3.8, on Microsoft Windows

is there any fix for this issue.?

@Elmahdi1962 @NeupaneSusan Can you post your current version (flutter doctor -v) as well as a way to reproduce it? Thank you.

@dkwingsmt

Please only report if this error exists on v3.4.0 or later.

I know 3.4.0 and later versions don't have this issue. What about 3.3.x? I think most people have been reporting in hope that the fix will be cherry-picked to the stable branch. Is either a hotfix or the new major stable version coming soon? Otherwise, we'll have to keep avoiding using 3.3 for another month or even more possibly.

Same problem here, windows 11. Long pressing shift key or ctrl key triggers the problem.
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.9, on Microsoft Windows [Version 10.0.22621.819], locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[✓] Chrome - develop for the web
[✓] Visual Studio - develop for Windows (Visual Studio Community 2022 17.3.6)
[✓] Android Studio (version 2021.2)
[✓] VS Code, 64-bit edition (version 1.73.1)
[✓] Connected device (4 available)
[✓] HTTP Host Availability

• No issues found!

modify this file to resolve this bug:~\flutter\packages\flutter\lib\src\services\hardware_keyboard.dart
line: 535
bool handleKeyEvent(KeyEvent event) {
    // _assertEventIsRegular(event); // this method assert will throw exception,but we need not this exception -_-!
    final PhysicalKeyboardKey physicalKey = event.physicalKey;
    final LogicalKeyboardKey logicalKey = event.logicalKey;
    if (event is KeyDownEvent) {
      _pressedKeys[physicalKey] = logicalKey;
      final KeyboardLockMode? lockMode = KeyboardLockMode.findLockByLogicalKey(event.logicalKey);
      if (lockMode != null) {
        if (_lockModes.contains(lockMode)) {
          _lockModes.remove(lockMode);
        } else {
          _lockModes.add(lockMode);
        }
      }
    } else if (event is KeyUpEvent) {
      _pressedKeys.remove(physicalKey);
    } else if (event is KeyRepeatEvent) {
      // Empty
    }

    return _dispatchKeyEvent(event);
  }

modify this file to resolve this bug:~\flutter\packages\flutter\lib\src\services\hardware_keyboard.dart line: 535
bool handleKeyEvent(KeyEvent event) {
    // _assertEventIsRegular(event); // this method assert will throw exception,but we need not this exception -_-!
    final PhysicalKeyboardKey physicalKey = event.physicalKey;
    final LogicalKeyboardKey logicalKey = event.logicalKey;
    if (event is KeyDownEvent) {
      _pressedKeys[physicalKey] = logicalKey;
      final KeyboardLockMode? lockMode = KeyboardLockMode.findLockByLogicalKey(event.logicalKey);
      if (lockMode != null) {
        if (_lockModes.contains(lockMode)) {
          _lockModes.remove(lockMode);
        } else {
          _lockModes.add(lockMode);
        }
      }
    } else if (event is KeyUpEvent) {
      _pressedKeys.remove(physicalKey);
    } else if (event is KeyRepeatEvent) {
      // Empty
    }

    return _dispatchKeyEvent(event);
  }

This worked

Just doing small research that when pressed any modifier, the keyboard event was going like:
KeyDown -> KeyUp -> KeyRepeat
But the KeyRepeat assert that the repeated key should be on the press state.
The keyup event was the synthesized=true
From the code document it says:

/// If [synthesized] is true, this event does not correspond to a native event.
///
/// Although most of Flutter's keyboard events are transformed from native
/// events, some events are not based on native events, and are synthesized
/// only to conform Flutter's key event model (as documented in
/// the HardwareKeyboard class in the framework).
///
/// For example, some key downs or ups might be lost when the window loses
/// focus. Some platforms provides ways to query whether a key is being held.
/// If the embedder detects an inconsistency between its internal record and
/// the state returned by the system, the embedder will synthesize a
/// corresponding event to synchronize the state without breaking the event
/// model.
///
/// As another example, macOS treats CapsLock in a special way by sending
/// down and up events at the down of alterate presses to indicate the
/// direction in which the lock is toggled instead of that the physical key is
/// going. A macOS embedder should normalize the behavior by converting a
/// native down event into a down event followed immediately by a synthesized
/// up event, and the native up event also into a down event followed
/// immediately by a synthesized up event.
///
/// Synthesized events do not have a trustworthy [timeStamp], and should not be
/// processed as if the key actually went down or up at the time of the
/// callback.

I can not do further check because when try to go deeper on callstack, it says source not available. And seems I will need to checkout the flutter sources.

Same problem in 3.3.10

Same problem since 2019, hope this year they fix it

any updates?

Flutter 3.8 and i have the same error, any updates to it?

Flutter 3.8 and i have the same error, any updates to it?

Flutter 3.7 stable on my win11 doesn't take place this error.

Flutter 3.8 and i have the same error, any updates to it?

@GabrielPagotto Did you mean Flutter 3.3.8? Thank you to provide your flutter doctor -v result.

modify this file to resolve this bug:~\flutter\packages\flutter\lib\src\services\hardware_keyboard.dart line: 535
bool handleKeyEvent(KeyEvent event) {
    // _assertEventIsRegular(event); // this method assert will throw exception,but we need not this exception -_-!
    final PhysicalKeyboardKey physicalKey = event.physicalKey;
    final LogicalKeyboardKey logicalKey = event.logicalKey;
    if (event is KeyDownEvent) {
      _pressedKeys[physicalKey] = logicalKey;
      final KeyboardLockMode? lockMode = KeyboardLockMode.findLockByLogicalKey(event.logicalKey);
      if (lockMode != null) {
        if (_lockModes.contains(lockMode)) {
          _lockModes.remove(lockMode);
        } else {
          _lockModes.add(lockMode);
        }
      }
    } else if (event is KeyUpEvent) {
      _pressedKeys.remove(physicalKey);
    } else if (event is KeyRepeatEvent) {
      // Empty
    }

    return _dispatchKeyEvent(event);
  }

This one worked

Flutter 3.7 and i have the same error, any updates to it?

Sorry, I meant 3.7. has been edited

Flutter 3.8 and i have the same error, any updates to it?

@GabrielPagotto Did you mean Flutter 3.3.8? Thank you to provide your flutter doctor -v result.

PS C:\Users\Gabriel\Desktop\phdclouderp-frontend> flutter doctor -v
[√] Flutter (Channel stable, 3.7.0, on Microsoft Windows [versÆo 10.0.22621.1105], locale pt-BR)
• Flutter version 3.7.0 on channel stable at C:\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision b06b8b2710 (8 days ago), 2023-01-23 16:55:55 -0800
• Engine revision b24591ed32
• Dart version 2.19.0
• DevTools version 2.20.1
[X] Windows Version (Unable to confirm if installed Windows version is 10 or greater)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
• Android SDK at C:\Users\Phd Front\AppData\Local\Android\Sdk
• Platform android-33-ext4, build-tools 33.0.1
• ANDROID_HOME = C:\Users\Phd Front\AppData\Local\Android\Sdk
• Java binary at: C:\Program Files\OpenJDK\jdk-12.0.2\bin\java
• Java version OpenJDK Runtime Environment (build 12.0.2+10)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.7)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
• Visual Studio Community 2019 version 16.11.31911.196
• Windows 10 SDK version 10.0.19041.0
[!] Android Studio (version 2022.1)
• Android Studio at C:\Program Files\Android\Android Studio1
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
X Unable to find bundled Java version.
• Try updating or re-installing Android Studio.
[√] VS Code (version 1.74.3)
• VS Code at C:\Users\Gabriel\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.58.0
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64    • Microsoft Windows [versÆo 10.0.22621.1105]
• Chrome (web)      • chrome  • web-javascript • Google Chrome 109.0.5414.120
• Edge (web)        • edge    • web-javascript • Microsoft Edge 109.0.1518.70
[√] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 3 categories.

Windows version is 11

Flutter 3.7 and i have the same error, any updates to it?

@GabrielPagotto Did you mean Flutter 3.3.8? Thank you to provide your flutter doctor -v result.

[√] Flutter (Channel stable, 3.7.0, on Microsoft Windows [versÆo 10.0.22621.1105], locale pt-BR)
    • Flutter version 3.7.0 on channel stable at C:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision b06b8b2710 (8 days ago), 2023-01-23 16:55:55 -0800
    • Engine revision b24591ed32
    • Dart version 2.19.0
    • DevTools version 2.20.1

[X] Windows Version (Unable to confirm if installed Windows version is 10 or greater)

[!] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at C:\Users\Phd Front\AppData\Local\Android\Sdk
    • Platform android-33-ext4, build-tools 33.0.1
    • ANDROID_HOME = C:\Users\Phd Front\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\OpenJDK\jdk-12.0.2\bin\java
    • Java version OpenJDK Runtime Environment (build 12.0.2+10)
    ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.7)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.11.31911.196
    • Windows 10 SDK version 10.0.19041.0

[!] Android Studio (version 2022.1)
    • Android Studio at C:\Program Files\Android\Android Studio1
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    X Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[√] VS Code (version 1.74.3)
    • VS Code at C:\Users\Gabriel\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.58.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [versÆo 10.0.22621.1105]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 109.0.5414.120
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 109.0.1518.70

[√] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 3 categories.

Windows version is 11

════════ Exception caught by services library ══════════════════════════════════
Attempted to send a key down event when no keys are in keysPressed. This state can occur if the key event being sent doesn't properly set its modifier flags. This was the event: RawKeyDownEvent#d05b3(logicalKey: LogicalKeyboardKey#e5ce6(keyId: "0x200000104", keyLabel: "Alt Left", debugName: "Alt Left"), physicalKey: PhysicalKeyboardKey#f0183(usbHidUsage: "0x000700e2", debugName: "Alt Left"), repeat: false) and its data: RawKeyEventDataWindows#6e2f8(keyCode: 164, scanCode: 56, characterCodePoint: 0, modifiers: 0)
'package:flutter/src/services/raw_keyboard.dart':
raw_keyboard.dart:1
Failed assertion: line 695 pos 7: 'event is! RawKeyDownEvent || _keysPressed.isNotEmpty'
════════════════════════════════════════════════════════════════════════════════
Similar error to those reported above with, slightly different wording. As the error message states, it's happening when no keys are pressed. It happens randomly.
Flutter 3.10
Windows 11

This problem of the Failed assertion: '_pressedKeys.containsKey(event.physicalKey)' happens for me

developing on Windows 11 with Visual Studio Code
running my application in debug mode on an Android 7.1.1 device (real Sony Z5 device)
using Flutter 3.10.5 or 3.10.6

The problem happens completely randomly, out of nowhere.

Flutter Channel stable, 3.13.9, on Microsoft Windows
flutter doctor

 Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.13.9, on Microsoft Windows [版本 10.0.22621.2715], locale zh-CN)
[✓] Windows Version (Installed version of Windows is version 10 or higher)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Chrome - develop for the web
[✓] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.3.5)
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.84.2)
[✓] Connected device (4 available)
[!] Network resources
    ✗ A cryptographic error occurred while checking "https://pub.dev/": Connection terminated during handshake
      You may be experiencing a man-in-the-middle attack, your network may be compromised, or you may have malware
      installed on your computer.
    ✗ A network error occurred while checking "https://maven.google.com/": 信号灯超时时间已到
! Doctor found issues in 1 category.

Logs

Unable to parse JSON message:
The document is empty.
══╡ EXCEPTION CAUGHT BY SERVICES LIBRARY ╞══════════════════════════════════════════════════════════
The following assertion was thrown during a platform message callback:
Attempted to send a key down event when no keys are in keysPressed. This state can occur if the key
event being sent doesn't properly set its modifier flags. This was the event:
RawKeyDownEvent#c861a(logicalKey: LogicalKeyboardKey#df100(keyId: "0x200000102", keyLabel: "Shift
Left", debugName: "Shift Left"), physicalKey: PhysicalKeyboardKey#ed430(usbHidUsage: "0x000700e1",
debugName: "Shift Left"), repeat: false) and its data: RawKeyEventDataWindows#f187a(keyCode: 160,
scanCode: 42, characterCodePoint: 0, modifiers: 0)
'package:flutter/src/services/raw_keyboard.dart':
Failed assertion: line 695 pos 7: 'event is! RawKeyDownEvent || _keysPressed.isNotEmpty'
Either the assertion indicates an error in the framework itself, or we should provide substantially
more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=2_bug.yml
When the exception was thrown, this was the stack:
#2      RawKeyboard.handleRawKeyEvent (package:flutter/src/services/raw_keyboard.dart:695:7)
#3      KeyEventManager.handleRawKeyMessage (package:flutter/src/services/hardware_keyboard.dart:1018:30)
#4      BasicMessageChannel.setMessageHandler. (package:flutter/src/services/platform_channel.dart:212:49)
#5      _DefaultBinaryMessenger.setMessageHandler. (package:flutter/src/services/binding.dart:567:35)
#6      _invoke2 (dart:ui/hooks.dart:202:13)
#7      _ChannelCallbackRecord.invoke (dart:ui/channel_buffers.dart:45:5)
#8      _Channel.push (dart:ui/channel_buffers.dart:135:31)
#9      ChannelBuffers.push (dart:ui/channel_buffers.dart:331:17)
#10     PlatformDispatcher._dispatchPlatformMessage (dart:ui/platform_dispatcher.dart:736:22)
#11     _dispatchPlatformMessage (dart:ui/hooks.dart:114:31)
(elided 2 frames from class _AssertionError)
════════════════════════════════════════════════════════════════════════════════════════════════════
Unable to parse JSON message:
Another exception was thrown: Attempted to send a key down event when no keys are in keysPressed. This state can occur if the key event being sent doesn't properly set its modifier flags. This was the event: RawKeyDownEvent#67e00(logicalKey: LogicalKeyboardKey#df100(keyId: "0x200000102", keyLabel: "Shift Left", debugName: "Shift Left"), physicalKey: PhysicalKeyboardKey#ed430(usbHidUsage: "0x000700e1", debugName: "Shift Left"), repeat: false) and its data: RawKeyEventDataWindows#f187a(keyCode: 160, scanCode: 42, characterCodePoint: 0, modifiers: 0)

I couldn't reproduce it in 3.13.9 and it worked fine, but upgrade to 3.16.5 and it came up again.
My reproduction steps:

Create a new project
Run on Windows platform
3, Hold down the Ctrl key when the APP window gets focus (you can tell by watching the other window lose focus. If you hold down the Ctrl key at first, the APP will not pop up in the foreground.)
Get errors...

I have found that some third-party software can also cause this issue, such as "智谱清言". Right click on the taskbar icon of this application and select “启用工具条”（Enable toolbar）. Then select some text in the Flutter application, and a toolbar will be displayed at the mouse position. Click on it, and it will send Ctrl+C to the current window (Flutter application), which will trigger this issue.
Some translation applications seem to follow this approach, sending a Ctrl+C event when selecting text in other windows, and then reading the content from the clipboard, and then displaying a translation pop-up window, but most software does not cause this issue. It seems to be a problem with individual software.
My flutter SDK is 3.16.5

Record the current issues encountered.
The problem I am currently facing is that one of my users has noticed that sometimes shortcut keys do not work (the application uses the 3.13.9 SDK). When this issue occurs, I check his computer, There has always been a Key in RawKeyboard.instance._keysPressed, and the LogicalKeyboardKey is "right Alt", but I have not seen the PhysicalKeyboardKey. The usbHidUsage is 0x160000e000, and the debugName does not display the correct name. I pressed all the keys on his keyboard, but couldn't find it. Pressing "right Alt" on the keyboard also couldn't make the key disappear from the _keysPressed. Therefore, I suspect that it may have been sent by a third-party application, but I couldn't find it.
Fortunately, It seems that the HardwareKeyboard.instance._pressedKeys are normal on that user's computer, and the new version of Flutter SDK (3.19) Shortcuts Widget also uses onKeyEvent instead of onKey. Therefore, upgrading the SDK may solve this problem.
I am not sure if this issue("
A KeyRepeatEvent is dispatched...") has occurred, as it is in release mode and there is no assert. But it's also related to HardwareKeyboard and RawKeyboard, I hope it's helpful. But if there's anything wrong with me, I'm sorry for that.

I have this issue too in flutter 3.19.6 and windows 10. backspace and delete keys just stop working. this is flutter doctor -v:
[√] Flutter (Channel stable, 3.19.6, on Microsoft Windows [Version 10.0.19045.4412], locale en-US)
    • Flutter version 3.19.6 on channel stable at C:\Users\Golnaaz\dev\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 54e66469a9 (8 weeks ago), 2024-04-17 13:08:03 -0700
    • Engine revision c4cd48e186
    • Dart version 3.3.4
    • DevTools version 2.31.1

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\Golnaaz\AppData\Local\Android\sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.9.6)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.9.34728.123
    • Windows 10 SDK version 10.0.22621.0

[√] Android Studio (version 2023.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)

[√] VS Code, 64-bit edition (version 1.88.1)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 3.90.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19045.4412]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 125.0.6422.142
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 125.0.2535.92

[√] Network resources
    • All expected network resources are available.

• No issues found!

When the app is starting and press on keyboard the error throws.