Repository navigation
Null check operator used on a null value occurs in EditableTextState when entering text on Galaxy keyboard #112046
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
r: duplicateIssue is closed as a duplicate of an existing issueIssue is closed as a duplicate of an existing issue
Description
Steps to Reproduce
This error only occurs on Galaxy as far as I can confirm.
I couldn't check it on my Xiaomi Pad 5.
- Execute
flutter runon the code sample with Galaxy device - Enter some text in the TextField
- An error occurs when I press the decision button of IME
Expected results:
The following _CastError was thrown during method call TextInputClient.performPrivateCommand: Null check operator used on a null value
Actual results:
======== Exception caught by services library ======================================================
The following _CastError was thrown during method call TextInputClient.performPrivateCommand:
Null check operator used on a null value
When the exception was thrown, this was the stack:
#0 EditableTextState.performPrivateCommand (package:flutter/src/widgets/editable_text.dart:2155:31)
#1 TextInput._handleTextInputInvocation (package:flutter/src/services/text_input.dart:1821:37)
#2 TextInput._loudlyHandleTextInputInvocation (package:flutter/src/services/text_input.dart:1701:20)
#3 MethodChannel._handleAsMethodCall (package:flutter/src/services/platform_channel.dart:536:55)
#4 MethodChannel.setMethodCallHandler.<anonymous closure> (package:flutter/src/services/platform_channel.dart:529:34)
#5 _DefaultBinaryMessenger.setMessageHandler.<anonymous closure> (package:flutter/src/services/binding.dart:387:35)
#6 _invoke2 (dart:ui/hooks.dart:186:13)
#7 _ChannelCallbackRecord.invoke (dart:ui/channel_buffers.dart:42:5)
#8 _Channel.push (dart:ui/channel_buffers.dart:132:31)
#9 ChannelBuffers.push (dart:ui/channel_buffers.dart:329:17)
#10 PlatformDispatcher._dispatchPlatformMessage (dart:ui/platform_dispatcher.dart:599:22)
#11 _dispatchPlatformMessage (dart:ui/hooks.dart:89:31)
call: MethodCall(TextInputClient.performPrivateCommand, [1, {data: {yomi: あ}, action: com.sec.android.inputmethod.iwnnime.japan}])
====================================================================================================
I/ViewRootImpl@ec33a10[MainActivity](27215): ViewPostIme pointer 0
I/ViewRootImpl@ec33a10[MainActivity](27215): ViewPostIme pointer 1
I/ViewRootImpl@ec33a10[MainActivity](27215): ViewPostIme pointer 0
I/ViewRootImpl@ec33a10[MainActivity](27215): ViewPostIme pointer 1
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(
primarySwatch: Colors.blue,
),
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
const MyHomePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Flutter Demo Home Page'),
),
body: const Center(child: TextField()),
);
}
}Logs
[+5490 ms] I/InputMethodManager(29583): showSoftInput(View,I)
[ +1 ms] D/InputMethodManager(29583): SSI - flag : 0 Pid : 29583 view : com.example.flutter_bug_sample
[ +1 ms] W/InputMethodManager(29583): showSoftInput(V,I,ResultReceiver)
[ ] D/InputMethodManager(29583): prepareNavigationBarInfo() DecorView@6852e6a[MainActivity]
[ ] D/InputMethodManager(29583): getNavigationBarColor() -855310
[ ] D/InputConnectionAdaptor(29583): The input method toggled text monitoring on
[+1167 ms] D/InputConnectionAdaptor(29583): The input method toggled text monitoring off
[ +81 ms]
══╡ EXCEPTION CAUGHT BY SERVICES LIBRARY ╞══════════════════════════════════════════════════════════
The following _CastError was thrown during method call TextInputClient.performPrivateCommand:
Null check operator used on a null value
When the exception was thrown, this was the stack:
#0 EditableTextState.performPrivateCommand
(package:flutter/src/widgets/editable_text.dart:2155:31)
#1 TextInput._handleTextInputInvocation (package:flutter/src/services/text_input.dart:1821:37)
#2 TextInput._loudlyHandleTextInputInvocation
(package:flutter/src/services/text_input.dart:1701:20)
#3 MethodChannel._handleAsMethodCall (package:flutter/src/services/platform_channel.dart:536:55)
#4 MethodChannel.setMethodCallHandler.<anonymous closure>
(package:flutter/src/services/platform_channel.dart:529:34)
#5 _DefaultBinaryMessenger.setMessageHandler.<anonymous closure>
(package:flutter/src/services/binding.dart:387:35)
#6 _invoke2 (dart:ui/hooks.dart:186:13)
#7 _ChannelCallbackRecord.invoke (dart:ui/channel_buffers.dart:42:5)
#8 _Channel.push (dart:ui/channel_buffers.dart:132:31)
#9 ChannelBuffers.push (dart:ui/channel_buffers.dart:329:17)
#10 PlatformDispatcher._dispatchPlatformMessage (dart:ui/platform_dispatcher.dart:599:22)
#11 _dispatchPlatformMessage (dart:ui/hooks.dart:89:31)
call:
MethodCall(TextInputClient.performPrivateCommand, [1, {data: {yomi: あ}, action:
com.sec.android.inputmethod.iwnnime.japan}])
════════════════════════════════════════════════════════════════════════════════════════════════════
flutter analyze
Analyzing flutter_bug_sample...
No issues found! (ran in 2.6s)
PS C:\Users\tuxsnct\Projects\flutter_bug_sample> flutter doctor -v
[√] Flutter (Channel stable, 3.3.2, on Microsoft Windows [Version 10.0.22000.978], locale ja-JP)
• Flutter version 3.3.2 on channel stable at C:\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision e3c29ec00c (7 days ago), 2022-09-14 08:46:55 -0500
• Engine revision a4ff2c53d8
• Dart version 2.18.1
• DevTools version 2.15.0
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at C:\Users\tuxsnct\AppData\Local\Android\sdk
• Platform android-33, build-tools 33.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.
[X] Visual Studio - develop for Windows
X Visual Studio not installed; this is necessary for Windows development.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[√] 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.70.0)
• VS Code at C:\Users\tuxsnct\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.46.0
[√] Connected device (2 available)
• SCG09 (mobile) • R3CR10MJBMP • android-arm64 • Android 11 (API 30)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22000.978]
[√] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 1 category.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
r: duplicateIssue is closed as a duplicate of an existing issueIssue is closed as a duplicate of an existing issue
Activity
hidekitux commentedon Sep 21, 2022
In flutter\lib\src\widgets\editable_text.dart, if I change EditableTextState.performPrivateCommand to:
ksokolovskyi commentedon Sep 21, 2022
We spot the same error on the users' Samsung devices (samsung SM-T580, samsung SM-S908B, samsung SM-A326B)
Flutter version 3.3.2
itismrx commentedon Sep 21, 2022
I am facing the same error on Samsung Galaxy J6 (SM J600G). Flutter version 3.3.0.
`
When the exception was thrown, this was the stack:
#0 EditableTextState.performPrivateCommand (package:flutter/src/widgets/editable_text.dart:2155:31)
#1 TextInput._handleTextInputInvocation (package:flutter/src/services/text_input.dart:1821:37)
#2 TextInput._loudlyHandleTextInputInvocation (package:flutter/src/services/text_input.dart:1701:20)
#3 MethodChannel._handleAsMethodCall (package:flutter/src/services/platform_channel.dart:536:55)
#4 MethodChannel.setMethodCallHandler. (package:flutter/src/services/platform_channel.dart:529:34)
#5 _DefaultBinaryMessenger.setMessageHandler. (package:flutter/src/services/binding.dart:387:35)
#6 _invoke2 (dart:ui/hooks.dart:186:13)
#7 _ChannelCallbackRecord.invoke (dart:ui/channel_buffers.dart:42:5)
#8 _Channel.push (dart:ui/channel_buffers.dart:132:31)
#9 ChannelBuffers.push (dart:ui/channel_buffers.dart:329:17)
#10 PlatformDispatcher._dispatchPlatformMessage (dart:ui/platform_dispatcher.dart:599:22)
#11 _dispatchPlatformMessage (dart:ui/hooks.dart:89:31)
call:
MethodCall(TextInputClient.performPrivateCommand, [1, {data: {}, action: Normal_Mode}])
════════════════════════════════════════════════════════════════════════════════════════════════════
`
huycozy commentedon Sep 21, 2022
Hi @tuxsnct, @ksokolovskyi, @itismrx
I can not reproduce the issue on the latest
stableandmasterchannels.My device:
Samsung Galaxy Tab A7 Lite, Android 12 OneUI 4.1, SM-T225However, I see there's an open issue addressing the case you described #97634
Closing this issue as a duplicate, so please follow up on it for further updates. You can leave there your comment and react an upvote to the original comment will help to raise the issue. Thank you!
damian4891 commentedon Oct 3, 2022
Our app has 500,000 users, and we received 690 crash reports last night. Also using flutter 3.3.3. Same error on EVERY single crash report, and every device was Samsung:
This issue needs to please be URGENTLY FIXED. The exact lines of code causing the crash are clearly shown in the error log, surely it isn't that hard to fix? We cannot afford to have hundreds of crashes every day due to flutter bugs.
aprzedecki commentedon Oct 6, 2022
The same for my app Flutter 3.3.2.
GrrMoura commentedon Oct 7, 2022
hey guys, any idea how to fix it ?
Simon-PumpAndUp commentedon Oct 12, 2022
Same as OP. flutter run -> text input and get the following:
`══╡ EXCEPTION CAUGHT BY SERVICES LIBRARY ╞══════════════════════════════════════════════════════════
The following _CastError was thrown during method call TextInputClient.performPrivateCommand:
Null check operator used on a null value
When the exception was thrown, this was the stack:
#0 EditableTextState.performPrivateCommand (package:flutter/src/widgets/editable_text.dart:2155:31)
#1 TextInput._handleTextInputInvocation (package:flutter/src/services/text_input.dart:1821:37)
#2 TextInput._loudlyHandleTextInputInvocation (package:flutter/src/services/text_input.dart:1701:20)
#3 MethodChannel._handleAsMethodCall (package:flutter/src/services/platform_channel.dart:536:55)
#4 MethodChannel.setMethodCallHandler. (package:flutter/src/services/platform_channel.dart:529:34)
#5 _DefaultBinaryMessenger.setMessageHandler. (package:flutter/src/services/binding.dart:387:35)
#6 _invoke2 (dart:ui/hooks.dart:186:13)
#7 _ChannelCallbackRecord.invoke (dart:ui/channel_buffers.dart:42:5)
#8 _Channel.push (dart:ui/channel_buffers.dart:132:31)
#9 ChannelBuffers.push (dart:ui/channel_buffers.dart:329:17)
#10 PlatformDispatcher._dispatchPlatformMessage (dart:ui/platform_dispatcher.dart:599:22)
#11 _dispatchPlatformMessage (dart:ui/hooks.dart:89:31)
call:
MethodCall(TextInputClient.performPrivateCommand, [1, {data: {}, action: Normal_Mode}])
════════════════════════════════════════════════════════════════════════════════════════════════════`
github-actions commentedon Oct 26, 2022
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.