Repository navigation
Flutter 3.29 Fatal crash with java.lang.AssertionError #164626
Copy link
Copy link
Closed
Labels
a: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsc: fatal crashCrashes that terminate the processCrashes that terminate the processe: device-specificOnly manifests on certain devicesOnly manifests on certain devicesframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.platform-androidAndroid applications specificallyAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-androidOwned by Android platform teamOwned by Android platform team
Description
Steps to reproduce
1 Create new android project
flutter create --org com.example --platforms=android -a kotlin hello
2 Run on Android device with a physical keyboard, example Urovo RT40
3 Press and hold the ALT button
PhysicalKeyboardKey#91568(usbHidUsage: "0x1100000039", debugName: "Key with ID 0x1100000039")
Expected results
nothing
Actual results
Crash
Code sample
Code sample
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
void _incrementCounter() {
setState(() {
_counter++;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text('You have pushed the button this many times:'),
Text(
'$_counter',
style: Theme.of(context).textTheme.headlineMedium,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: const Icon(Icons.add),
),
);
}
}
Screenshots or Video
UROVO RT40
vid.webm
Logs
Logs
E/InputEventSender( 4705): Exception dispatching finished signal.
E/MessageQueue-JNI( 4705): Exception in MessageQueue callback: handleReceiveCallback
E/MessageQueue-JNI( 4705): java.lang.AssertionError: The key was empty
E/MessageQueue-JNI( 4705): at io.flutter.embedding.android.KeyEmbedderResponder.updatePressingState(KeyEmbedderResponder.java:116)
E/MessageQueue-JNI( 4705): at io.flutter.embedding.android.KeyEmbedderResponder.synthesizeEvent(KeyEmbedderResponder.java:390)
E/MessageQueue-JNI( 4705): at io.flutter.embedding.android.KeyEmbedderResponder.lambda$synchronizePressingKey$1$io-flutter-embedding-android-KeyEmbedderResponder(KeyEmbedderResponder.java:185)
E/MessageQueue-JNI( 4705): at io.flutter.embedding.android.KeyEmbedderResponder$$ExternalSyntheticLambda2.run(D8$$SyntheticClass:0)
E/MessageQueue-JNI( 4705): at io.flutter.embedding.android.KeyEmbedderResponder.handleEventImpl(KeyEmbedderResponder.java:375)
E/MessageQueue-JNI( 4705): at io.flutter.embedding.android.KeyEmbedderResponder.handleEvent(KeyEmbedderResponder.java:431)
E/MessageQueue-JNI( 4705): at io.flutter.embedding.android.KeyboardManager.handleEvent(KeyboardManager.java:229)
E/MessageQueue-JNI( 4705): at io.flutter.embedding.android.FlutterView.dispatchKeyEvent(FlutterView.java:881)
3
E/MessageQueue-JNI( 4705): at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
E/MessageQueue-JNI( 4705): at com.android.internal.policy.DecorView.superDispatchKeyEvent(DecorView.java:453)
E/MessageQueue-JNI( 4705): at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1839)
E/MessageQueue-JNI( 4705): at android.app.Activity.dispatchKeyEvent(Activity.java:3972)
E/MessageQueue-JNI( 4705): at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:367)Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.29.0, on Ubuntu 24.04.2 LTS 6.8.0-54-generic, locale ru_RU.UTF-8) [86ms]
• Flutter version 3.29.0 on channel stable at /usr/local/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 35c388afb5 (3 недели назад), 2025-02-10 12:48:41 -0800
• Engine revision f73bfc4522
• Dart version 3.7.0
• DevTools version 2.42.2
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [1 094ms]
• Android SDK at /home/pavel/Android/Sdk
• Platform android-35, build-tools 35.0.0
• Java binary at: /usr/local/android-studio/jbr/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 21.0.4+-12422083-b607.1)
• All Android licenses accepted.
[✓] Chrome - develop for the web [13ms]
• Chrome at google-chrome
[✓] Linux toolchain - develop for Linux desktop [140ms]
• Ubuntu clang version 18.1.3 (1ubuntu1)
• cmake version 3.28.3
• ninja version 1.11.1
• pkg-config version 1.8.1
[✓] Android Studio (version 2024.2) [11ms]
• Android Studio at /usr/local/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 21.0.4+-12422083-b607.1)
[✓] VS Code (version 1.97.2) [10ms]
• VS Code at /usr/share/code
• Flutter extension version 3.106.0
[✓] Connected device (3 available) [190ms]
• RT40 (mobile) • 4932d4d1 • android-arm64 • Android 10 (API 29)
• Linux (desktop) • linux • linux-x64 • Ubuntu 24.04.2 LTS 6.8.0-54-generic
• Chrome (web) • chrome • web-javascript • Google Chrome 133.0.6943.141
[✓] Network resources [1 390ms]
• All expected network resources are available.
• No issues found!Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
a: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsc: fatal crashCrashes that terminate the processCrashes that terminate the processe: device-specificOnly manifests on certain devicesOnly manifests on certain devicesframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.platform-androidAndroid applications specificallyAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-androidOwned by Android platform teamOwned by Android platform team
Type
Projects
- StatusShow more project fieldsDone (PR merged)
Activity
maheshj01 commentedon Mar 6, 2025
Hi @mil-ast, Thanks for filing the issue. Looks like this issue is specific to this device, I haven't been able to reproduce this on a regular android device (Pixel 6 emulator) or desktop apps. Labelling for further investigation from the team.
flutter doctor -v
bleroux commentedon Mar 6, 2025
@mil-ast Thanks for filing this issue.
It would be great if you can run your sample after enabling keyboard logs.
Because the failure is in the engine side, framework logs won't show the exact key event which leads to this failure but it might give a hint.
To enable the logs set the
debugPrintKeyboardEventstotrue:mil-ast commentedon Mar 6, 2025
Logs
mil-ast commentedon Mar 6, 2025
I was able to reproduce the error in the emulator:
bleroux commentedon Mar 6, 2025
Great! I will investigate a fix for this issue.
[Android] Fix crash on some key repeat events (#165307)
github-actions commentedon Apr 1, 2025
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.