简体   繁体   中英

Flutter - Keyboard not showing up in android 12 devices

Keyboard is not showing up for android 12 devices, overlay comes indicating keyboard is on but nothing is shown. It is working properly for older android versions.

Keyboard is working fine in other apps & also works fine with simulator having android version other than Android 12. Tried with physical device also Pixel with android 12 facing the same issue.

flutter doctor code -

flutter doctor -v
[✓] Flutter (Channel stable, 2.2.3, on macOS 11.4 20F71 darwin-x64, locale en-IN)
    • Flutter version 2.2.3 at /Users/uable/Downloads/flutter
    • Framework revision f4abaa0735 (4 months ago), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/uable/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_HOME = /Users/uable/Library/Android/sdk
    • ANDROID_SDK_ROOT = /Users/uable/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[!] Xcode - develop for iOS and macOS
    ✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
      Download at: https://developer.apple.com/xcode/download/
      Or install Xcode via the App Store.
      Once installed, run:
        sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
        sudo xcodebuild -runFirstLaunch
    • CocoaPods version 1.10.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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 1.8.0_242-release-1644-b3-6222593)

[✓] Connected device (2 available)
    • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64    • Android 12 (API 31) (emulator)
    • Chrome (web)                 • chrome        • web-javascript • Google Chrome 95.0.4638.54

! Doctor found issues in 1 category.

Below is an image of simple text field with keyboard on have tried changing all properties of text field also. Its an existing application so tried testing the existing textfields even in those its showing the same behaviour.

android gradle settings

    minSdkVersion 24
    targetSdkVersion 30

在此处输入图像描述

在此处输入图片说明 I think this bug because this simulator error with system UI , u can wipe data of simulator then run again

Go to android simulator --> tools --> AVD Manager--> Select the device you are running and wipedata and run it again.

If it not works select another device and try it.

Am not sure, it may the problem in simulator .

as official document of webview flutter put

if (Platform.isAndroid) WebView.platform = AndroidWebView();

in your Main.dart

enter image description here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM