繁体   English   中英

Flutter - 键盘未出现在 android 12 台设备中

[英]Flutter - Keyboard not showing up in android 12 devices

键盘未显示 android 12 台设备,叠加层显示键盘已打开但未显示任何内容。 它适用于旧的 android 版本。

键盘在其他应用程序中工作正常并且在具有 android 版本而不是 Android 12 的模拟器中也工作正常。尝试使用物理设备也使用 Pixel android 12 面临同样的问题。

flutter 医生代码 -

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.

下面是带有键盘的简单文本字段的图像,也尝试更改文本字段的所有属性。 它是一个现有的应用程序,因此尝试测试现有的文本字段,即使在那些显示相同行为的文本字段中也是如此。

android gradle 设置

    minSdkVersion 24
    targetSdkVersion 30

在此处输入图像描述

在此处输入图片说明 我认为这个错误是因为这个模拟器错误与系统 UI,你可以擦除模拟器的数据然后再次运行

转到android模拟器-->工具--> AVD管理器-->选择您正在运行的设备并wipedata并再次运行它。

如果它不起作用,请选择其他设备并尝试。

我不确定,这可能是simulator的问题。

作为 webview flutter 的官方文件

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

在你的Main.dart

在此处输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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