Skip to content

[android] Janky Animation when opening keyboard #120435

Open

Description

@delfme

Animating a Platform View widget is janky.

Tested on latest stable and master 3.8.0-5.0.pre.1, android 12SKQ1.211006.001, xiaomi mi lite 11 5G.

Steps to Reproduce

Please run this simple example here:
https://github.com/delfme/flutter-native-text-input-repo

Expected results:
When opening keyboard, native widget should animate smoothly.

Actual results:
Native widget animation is janky.

videozip_459.MP4

Flutter doctor:

[✓] Flutter (Channel master, 3.8.0-5.0.pre.1, on macOS 12.2 21D49 darwin-arm64, locale en-IT)
[!] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
✗ cmdline-tools component is missing
Run path/to/sdkmanager --install "cmdline-tools;latest"
See https://developer.android.com/studio/command-line for more details.
✗ Android license status unknown.
Run flutter doctor --android-licenses to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

Activity

  1. darshankawar commented on Feb 13, 2023

    @darshankawar
    Member

    Thanks for the report @delfme
    Can you please enable performancOverlay and see if you get shader jank while opening the keyboard ?
    Also, is that the default device keyboard or external one such as Gboard ?

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

    @delfme
    Author

    @darshankawar here is the performanceOverlay. We have red frames when widget is rendered and on first keyboard opening. Then we can't observe red frames but animation is still jittery.

    cc: @jonahwilliams might this be the android equivalent of #120555 ?

    Screen.Recording.2023-02-13.at.09.44.38.mov
  4. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 13, 2023
  5. darshankawar commented on Feb 14, 2023

    @darshankawar
    Member

    Thanks for the update @delfme. The similar issue you linked states that it may not be related to platform-views #120555 (comment).
    Since this issue could also be related, although trying to S10 device, the jank I observed was not consistent and sometimes smooth with animation and the jank wasn't noticeable mostly.

    Is it possible to confirm without adding native textfield and check if the animation is still janky on the device you used ?

    https://github.com/delfme/flutter-native-text-input-repo/blob/d18841e1a0542e8fbe70dff463cade69448b1d7e/lib/demo_screen.dart#L99

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

    @delfme
    Author

    I will try to look into this. Indeed it seems that issue may not be due to platform view #120555 (comment)

    Can you also help with this? By disabling lines 98-
    131 and enabling 134-151 we can debug the issue with flutter textfield.

    https://github.com/delfme/flutter-native-text-input-repo/blob/d18841e1a0542e8fbe70dff463cade69448b1d7e/lib/demo_screen.dart#L98

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

    @darshankawar
    Member

    I tried as above, although I see some jank in performance overlay, the animation jank while opening the keyboard is not noticeable as it opens pretty smoothly on S10 atleast I tried on.

    I'll keep this issue open for team's attention and for better tracking.

  10. added
    platform-androidAndroid applications specifically
    c: performanceRelates to speed or footprint issues (see "perf:" labels)
    a: text inputEntering text in a text field or keyboard related problems
    engineflutter/engine related. See also e: labels.
    and removed
    in triagePresently being triaged by the triage team
    on Feb 15, 2023
  11. changed the title [-][android][platform view] Janky Animation[/-] [+][android] Janky Animation when opening keyboard[/+] on Feb 15, 2023
  12. delfme commented on Feb 15, 2023

    @delfme
    Author

    @darshankawar janks/jittery occurs randomly yet consistently. On my Xiaomi Mi Lite 11 is much evident. It might not be wrong animation curve. Right now we are debugging same issue on iOS and it seems to be caused by flutter engine, we saw GC and raster getting stuck waiting.

    If flutter team can work on this, the discovery on other issue should be helpful, or else we will try to have a look at this after iOS fix

  13. added
    P2Important issues not at the top of the work list
    on Feb 16, 2023
  14. delfme commented on Oct 6, 2023

    @delfme
    Author

    Linking here the unsync keyboard issue coz the two issues might be intertwined.
    #116836

  15. delfme commented on Apr 14, 2025

    @delfme
    Author

    @reidbaker saw you've recently triaged #163516 Would you be so kind as to check if the janky / stuttering keyboard animation still persists in Flutter 3.29? This issue affects both iOS and Android and significantly impacts the user experience.

  16. ice-kreios commented on Jul 15, 2025

    @ice-kreios
    import 'package:flutter/material.dart';
    
    void main() => runApp(const MyApp());
    
    class MyApp extends StatelessWidget {
      const MyApp({super.key});
      @override
      Widget build(BuildContext context) {
        return const MaterialApp(home: SampleApp());
      }
    }
    
    class SampleApp extends StatefulWidget {
      const SampleApp({super.key});
    
      @override
      State<SampleApp> createState() => _SampleAppState();
    }
    
    class _SampleAppState extends State<SampleApp> {
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          body: Column(
            mainAxisAlignment: MainAxisAlignment.end,
            children: [
              TextField(
                onTapOutside: (_) {
                  primaryFocus?.unfocus();
                },
              ),
            ],
          ),
        );
      }
    }
    
    

    I can reproduce this behavior using the provided sample code.

    ➜ flutter_application_2 flutter doctor
    Doctor summary (to see all details, run flutter
    doctor -v):
    [✓] Flutter (Channel stable, 3.32.5, on macOS
    15.5 24F74 darwin-arm64, locale en-US)
    [✓] Android toolchain - develop for Android
    devices (Android SDK version 36.0.0)
    [✓] Xcode - develop for iOS and macOS (Xcode
    16.4)
    [✓] Chrome - develop for the web
    [✓] Android Studio (version 2025.1)
    [✓] VS Code (version 1.102.0)
    [✓] Connected device (4 available)
    [✓] Network resources

    • No issues found!

  17. mdurmaz commented on Nov 25, 2025

    @mdurmaz
  18. IbrokhimMirzaev commented on Dec 2, 2025

    @IbrokhimMirzaev
  19. saibotma commented on Jun 6, 2026

    @saibotma

    I can still reproduce this on Flutter 3.44.1 with a native Android EditText embedded as a platform view.

    I also tested with HCPP enabled via --enable-hcpp on a Pixel 7. The keyboard/opening animation did not become noticeably smoother. In addition, the Android text magnifier regressed: only the magnifier background/shadow was visible, but the magnified text/content was not rendered.

    So at least for this native text input case, HCPP does not appear to solve the keyboard animation jank, and it introduces a separate text editing fidelity issue.

    This also seems related to #167547.

    Flutter 3.44.1
    Android device: Pixel 7
    Android version: 16
    Renderer: Impeller
    Native view: EditText
    Composition tested: classic Hybrid Composition and HCPP

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: animationAnimation APIsa: text inputEntering text in a text field or keyboard related problemsc: performanceRelates to speed or footprint issues (see "perf:" labels)engineflutter/engine related. See also e: labels.platform-androidAndroid applications specificallyteam-androidOwned by Android platform teamtriaged-androidTriaged by Android platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions