Skip to content

[Android][Samsung]: Tapping on special characters button from virtual keyboard triggers performPrivateCommand : onAppPrivateCommand @ EditableText: "_CastError (Null check operator used on a null value)" error. #97634

Closed

Description

@danielrrys

I have a Samsung Tab S2 version 7 android tablet.

I can't find anywhere a solution for this error, in the EditableText widget.

What happens is that in a TextFormField widget with its respective TextEditingController, I enter the name of my user, however I need this character " _ ", when I change to special characters on the keyboard to search for it... I get this error...

image

flutter doctor -v

[√] Flutter (Channel stable, 2.8.1, on Microsoft Windows [version 10.0.19044.1466], locale fr-FR)
    • Flutter version 2.8.1 at C:\src\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 77d935af4d (7 weeks ago), 2021-12-16 08:37:33 -0800
    • Engine revision 890a5fca2e
    • Dart version 2.15.1

[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at C:\Users\Daniel ROLDAN\AppData\Local\Android\Sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_HOME = C:\Users\Daniel ROLDAN\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

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

[√] Android Studio (version 2020.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.10+0-b96-7249189)

[√] VS Code (version 1.63.2)
    • VS Code at C:\Users\Daniel ROLDAN\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.32.0

[√] Connected device (3 available)
    • SM T813 (mobile) • 3b8bea59055e2627 • android-arm64  • Android 7.0 (API 24)
    • Chrome (web)     • chrome           • web-javascript • Google Chrome 93.0.4577.63
    • Edge (web)       • edge             • web-javascript • Microsoft Edge 96.0.1054.62

• No issues found!

image
image

This is a small example because in all the fields where I can write I get this error...

TextEditingController accountController = TextEditingController();

   Padding(
      padding: EdgeInsets.fromLTRB(20, 0, 20, 0),
      child: TextFormField(
        scrollPadding: EdgeInsets.only(
          bottom: Device.screenHeight * 0.25,
        ),
        controller: accountController ,
        textInputAction:
            widget.isPassword ? TextInputAction.done : TextInputAction.next,
        onFieldSubmitted: () {},
        enableSuggestions: !widget.isPassword,
        autocorrect: !widget.isPassword,
        obscureText: widget.isPassword && this.isPasswordHidden!,
        validator: () {},
        style: TextStyle(
          fontSize: 20,
        ),
        decoration: InputDecoration(
          suffixIcon: IconButton(
                  icon: Icon(
                    Icons.visibility_off,
                    size: 30,
                    color: DesignConstants.loginFontColor,
                  ),
                  onPressed: (){},
                  splashRadius: 10,
                ),
          hintText: widget.labelText,
          helperText: widget.helperText,
        ),
      ),
    )

Activity

  1. darshankawar commented on Feb 2, 2022

    @darshankawar
    Member

    @kauzige
    Can you provide complete error log ?
    And If I understand correctly, you want to enter a username containing an underscore, and in order to do that you tap on the special char button which throws the null check error. Is that correct interpretation ?
    Also to confirm this behavior, can you also check the same on latest master and see if it persists ?

  2. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 2, 2022
  3. danielrrys commented on Feb 2, 2022

    @danielrrys
    Author

    @darshankawar
    That's the weird thing here, when that happens it only happens when I use debug, and no errors appear in the console. The only thing that appears is this :

    image

    You are right, as the first image shows, when I click on the special characters I get that error.

    On the other hand, I have already changed to the latest master version and changed some compile version parameters that it asked me for and it still keeps that error only on my tablet, because on the mobile phone that does not happen and yes, I have already updated my tablet to the latest version.

    [√] Flutter (Channel master, 2.10.0-1.0.pre.375, on Microsoft Windows [version 10.0.19044.1466], locale fr-FR)
        • Flutter version 2.10.0-1.0.pre.375 at C:\src\flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 13b8f5aa8f (2 hours ago), 2022-02-02 07:05:09 -0500
        • Engine revision 4ff105d625
        • Dart version 2.17.0 (build 2.17.0-75.0.dev)
        • DevTools version 2.10.0
    
    [√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
        • Android SDK at C:\Users\Daniel ROLDAN\AppData\Local\Android\Sdk
        • Platform android-31, build-tools 31.0.0
        • ANDROID_HOME = C:\Users\Daniel ROLDAN\AppData\Local\Android\Sdk
        • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
        • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
        • 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 Build Tools 2017 15.9.42)
        • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools
        • Visual Studio Build Tools 2017 version 15.9.28307.1759
        • Windows 10 SDK version 10.0.17763.0
        X Visual Studio 2019 or later is required.
          Download at https://visualstudio.microsoft.com/downloads/.
          Please install the "Desktop development with C++" workload, including all of its default components
    
    [√] Android Studio (version 2020.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.10+0-b96-7249189)
    
    [√] VS Code (version 1.63.2)
        • VS Code at C:\Users\Daniel ROLDAN\AppData\Local\Programs\Microsoft VS Code
        • Flutter extension version 3.32.0
    
    [√] Connected device (4 available)
        • SM T813 (mobile)  • 3b8bea59055e2627 • android-arm64  • Android 7.0 (API 24)
        • Windows (desktop) • windows          • windows-x64    • Microsoft Windows [version 10.0.19044.1466]
        • Chrome (web)      • chrome           • web-javascript • Google Chrome 93.0.4577.63
        • Edge (web)        • edge             • web-javascript • Microsoft Edge 96.0.1054.62
    
    [√] HTTP Host Availability
        • All required HTTP hosts are available
    
    ! Doctor found issues in 1 category.
    
    
  4. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 2, 2022
  5. darshankawar commented on Feb 3, 2022

    @darshankawar
    Member

    @kauzige
    Thanks for the details. Can you also try a scenario wherein you input a text in TextFormField, enable debugger and try to delete one char at a time and see if you get the same _CastError or not ?
    Also try the same on an Android device and see what you get.

    The error you are getting [performPrivateCommand : onAppPrivateCommand](https://github.com/flutter/flutter/issues/97634#) indicates This is used to receive a private command from the input method.

  6. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 3, 2022
  7. danielrrys commented on Feb 3, 2022

    @danielrrys
    Author

    @darshankawar
    I don't seem to have any error when deleting one character at a time with the debugger, I just get that error when I press the special characters button. I have an android phone and I don't have any problem, I can enter the special characters and I don't get that error.

    What I understood with your answer is that the special characters button on the keyboard is a private method, isn't it? Do you know if there is a way to read that button in the code? Or what else could I do ?

    On the other hand, in the TextInput widget, there is a switch that tells me the following :

    image

    And this is where null data arrives, but I really don't understand why this happens on my tablet and not on my mobile phone cause in the phone does not fit in this case.

    image

  8. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 3, 2022
  9. darshankawar commented on Feb 3, 2022

    @darshankawar
    Member

    Thanks for further details.
    From what I know, performPrivateCommand is used to receive a private command from the input method and is called when the result of TextInputClient.performPrivateCommand is received, but I am not sure if triggering special characters button is the only factor to it or not.

    I am unable to verify this behavior since I don't have any Android Tablet to replicate, so I am going to label it for further input / investigation from the team.

  10. added
    a: null-safetySupport for Dart's null safety feature
    a: text inputEntering text in a text field or keyboard related problems
    engineflutter/engine related. See also e: labels.
    platform-androidAndroid applications specifically
    on Feb 3, 2022
  11. 19 remaining items

  12. dmitry-fbm commented on Oct 10, 2022

    @dmitry-fbm

    Can this please be fixed in the nearest hotfix release?

  13. pvsvamsi commented on Oct 19, 2022

    @pvsvamsi

    With these kind of new issues popping up in the new 'stable' releases, as a developer, I feel not to update flutter version, till the older version is deprecated. Can we at least have a better stable releases?

  14. added
    customer: crowdAffects or could affect many people, though not necessarily a specific customer.
    on Oct 20, 2022
  15. omarfaroke commented on Oct 25, 2022

    @omarfaroke

    Any updates here?

  16. sebdoy commented on Oct 30, 2022

    @sebdoy

    Same issue here, any fixes?

  17. kinex commented on Nov 4, 2022

    @kinex
  18. sostenesgomes commented on Nov 8, 2022

    @sostenesgomes

    @kinex thanks for reporting. I confirm that in 3.3.7 this issue was fixed.

  19. darshankawar commented on Nov 9, 2022

    @darshankawar
    Member

    Thanks for confirmation. Everyone else in this thread including OP @kauzige, please verify on latest stable version (3.3.7) and confirm, accordingly, I'll update the status of this issue. Thanks.

  20. ndahlquist commented on Nov 9, 2022

    @ndahlquist

    We can also confirm that we've seen no further reports of this issue since updating to 3.3.7 👍

  21. dmitry-fbm commented on Nov 10, 2022

    @dmitry-fbm

    Also can confirm this is fixed in 3.3.7, thanks.

  22. darshankawar commented on Nov 11, 2022

    @darshankawar
    Member

    Thanks for the update. Based on above recent confirmations, I am going ahead and closing this as fixed.
    If anybody disagrees, write in comments and I'll reopen it.

  23. added
    r: fixedIssue is closed as already fixed in a newer version
    on Nov 11, 2022
  24. github-actions commented on Nov 25, 2022

    @github-actions

    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 -v and a minimal reproduction of the issue.

  25. locked as resolved and limited conversation to collaborators on Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: debuggingDebugging, breakpoints, expression evaluationa: null-safetySupport for Dart's null safety featurea: text inputEntering text in a text field or keyboard related problemscustomer: crowdAffects or could affect many people, though not necessarily a specific customer.e: device-specificOnly manifests on certain devicesengineflutter/engine related. See also e: labels.platform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer version

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions