Skip to content

Null check operator used on a null value occurs in EditableTextState when entering text on Galaxy keyboard #112046

@hidekitux

Description

@hidekitux

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.

  1. Execute flutter run on the code sample with Galaxy device
  2. Enter some text in the TextField
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    r: duplicateIssue is closed as a duplicate of an existing issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions