-
Notifications
You must be signed in to change notification settings - Fork 27.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Null check operator used on a null _rawKeyboard.lookUpLayout(physicalKey)!
#88236
Comments
_rawKeyboard.lookUpLayout(physicalKey)!
Hi @narumishi |
@TahaTesser You can check The problem is occurred just in I cannot reproduce the problem on my own android device and even don't how to reproduce it. The only thing I know is that users are inputing text...... Every day, about 5 crash reports received while near 800 active devices in total. some devicesDevice parameters:
id: HUAWEILIO-AN00
board: LIO
bootloader: unknown
brand: HUAWEI
device: HWLIO
display: LIO-AN00 2.0.0.138(C00E130R5P5)
fingerprint: HUAWEI/LIO-AN00/HWLIO:10/HUAWEILIO-AN00/102.0.0.138C00:user/release-keys
hardware: kirin990
host: cn-central-hcd-2a-6aff77b631625990365105-8588f69d65-p7sf2
isPhysicalDevice: true
manufacturer: HUAWEI
model: LIO-AN00
product: LIO-AN00
tags: release-keys
type: user
versionBaseOs:
versionCodename: REL
versionIncremental: 102.0.0.138C00
versionPreviewSdk: 0
versionRelease: 10
versionSdk: 29
versionSecurityPatch: 2020-11-01
Device parameters:
id: HUAWEIELE-L29
board: ELE
bootloader: unknown
brand: HUAWEI
device: HWELE
display: ELE-L29 10.1.0.150(C431E22R2P5)
fingerprint: HUAWEI/ELE-L29EEA/HWELE:10/HUAWEIELE-L29/10.1.0.150C431:user/release-keys
hardware: kirin980
host: cn-central-1b-a687fa2531596186059456-3543762350-474m6
isPhysicalDevice: true
manufacturer: HUAWEI
model: ELE-L29
product: ELE-L29EEA
tags: release-keys
type: user
versionBaseOs: HUAWEI/ELE-L29EEA/HWELE:10/HUAWEIELE-L29/10.1.0.140C431:user/release-keys
versionCodename: REL
versionIncremental: 10.1.0.150C431
versionPreviewSdk: 0
versionRelease: 10
versionSdk: 29
versionSecurityPatch: 2020-08-01
Device parameters:
id: QP1A.190711.020
board: exynos7904
bootloader: M205GDXU7CUD2
brand: samsung
device: m20lte
display: QP1A.190711.020.M205GDXU7CUD2
fingerprint: samsung/m20ltedx/m20lte:10/QP1A.190711.020/M205GDXU7CUD2:user/release-keys
hardware: exynos7904
host: VPDJR204
isPhysicalDevice: true
manufacturer: samsung
model: SM-M205G
product: m20ltedx
tags: release-keys
type: user
versionBaseOs:
versionCodename: REL
versionIncremental: M205GDXU7CUD2
versionPreviewSdk: 0
versionRelease: 10
versionSdk: 29
versionSecurityPatch: 2021-04-01
Device parameters:
id: RP1A.200720.012
board: exynos9820
bootloader: G975FXXSBFUF3
brand: samsung
device: beyond2
display: RP1A.200720.012.G975FXXSBFUF3
fingerprint: samsung/beyond2ltexx/beyond2:11/RP1A.200720.012/G975FXXSBFUF3:user/release-keys
hardware: exynos9820
host: 21DJ7D15
isPhysicalDevice: true
manufacturer: samsung
model: SM-G975F
product: beyond2ltexx
tags: release-keys
type: user
versionBaseOs: samsung/beyond2ltexx/beyond2:11/RP1A.200720.012/G975FXXUAFUE3:user/release-keys
versionCodename: REL
versionIncremental: G975FXXSBFUF3
versionPreviewSdk: 0
versionRelease: 11
versionSdk: 30
versionSecurityPatch: 2021-07-01
Device parameters:
id: QP1A.190711.020
board: msmnile
bootloader: G9730ZCU4CTG2
brand: samsung
device: beyond1q
display: QP1A.190711.020.G9730ZCU4CTG2
fingerprint: samsung/beyond1qltezc/beyond1q:10/QP1A.190711.020/G9730ZCU4CTG2:user/release-keys
hardware: qcom
host: SWDH7904
isPhysicalDevice: true
manufacturer: samsung
model: SM-G9730
product: beyond1qltezc
tags: release-keys
type: user
versionBaseOs:
versionCodename: REL
versionIncremental: G9730ZCU4CTG2
versionPreviewSdk: 0
versionRelease: 10
versionSdk: 29
versionSecurityPatch: 2020-08-01
Device parameters:
id: HUAWEITAS-AL00
board: TAS
bootloader: unknown
brand: HUAWEI
device: HWTAS
display: TAS-AL00 11.0.0.180(C00E180R5P11)
fingerprint: HUAWEI/TAS-AL00/HWTAS:10/HUAWEITAS-AL00/11.0.0.180C00:user/release-keys
hardware: kirin990
host: cn-east-hcd-4a-769e4cbda1619805713044-69b57b57bf-7l8t7
isPhysicalDevice: true
manufacturer: HUAWEI
model: TAS-AL00
product: TAS-AL00
tags: release-keys
type: user
versionBaseOs:
versionCodename: REL
versionIncremental: 11.0.0.180C00
versionPreviewSdk: 0
versionRelease: 10
versionSdk: 29
versionSecurityPatch: 2020-11-01
Device parameters:
id: QP1A.190711.020
board: exynos7904
bootloader: A307GUBS4BUC1
brand: samsung
device: a30s
display: QP1A.190711.020.A307GUBS4BUC1
fingerprint: samsung/a30sub/a30s:10/QP1A.190711.020/A307GUBS4BUC1:user/release-keys
hardware: exynos7904
host: SWDH7019
isPhysicalDevice: true
manufacturer: samsung
model: SM-A307G
product: a30sub
tags: release-keys
type: user
versionBaseOs: samsung/a30sub/a30s:10/QP1A.190711.020/A307GUBU4BTJ3:user/release-keys
versionCodename: REL
versionIncremental: A307GUBS4BUC1
versionPreviewSdk: 0
versionRelease: 10
versionSdk: 29
versionSecurityPatch: 2021-03-01
Device parameters:
id: QP1A.190711.020
board: exynos7904
bootloader: A307GUBS4BUC1
brand: samsung
device: a30s
display: QP1A.190711.020.A307GUBS4BUC1
fingerprint: samsung/a30sub/a30s:10/QP1A.190711.020/A307GUBS4BUC1:user/release-keys
hardware: exynos7904
host: SWDH7019
isPhysicalDevice: true
manufacturer: samsung
model: SM-A307G
product: a30sub
tags: release-keys
type: user
versionBaseOs: samsung/a30sub/a30s:10/QP1A.190711.020/A307GUBU4BTJ3:user/release-keys
versionCodename: REL
versionIncremental: A307GUBS4BUC1
versionPreviewSdk: 0
versionRelease: 10
versionSdk: 29
versionSecurityPatch: 2021-03-01
Device parameters:
id: HUAWEITAS-AN00
board: TAS
bootloader: unknown
brand: HUAWEI
device: HWTAS
display: TAS-AN00 2.0.0.138(C00E130R6P5)
fingerprint: HUAWEI/TAS-AN00/HWTAS:10/HUAWEITAS-AN00/102.0.0.138C00:user/release-keys
hardware: kirin990
host: cn-central-hcd-2a-6aff77b631625990365105-8588f69d65-p7sf2
isPhysicalDevice: true
manufacturer: HUAWEI
model: TAS-AN00
product: TAS-AN00
tags: release-keys
type: user
versionBaseOs:
versionCodename: REL
versionIncremental: 102.0.0.138C00
versionPreviewSdk: 0
versionRelease: 10
versionSdk: 29
versionSecurityPatch: 2020-11-01
Device parameters:
id: NRD90M
board: universal7420
bootloader: N920KKKS2DTJ2
brand: samsung
device: nobleltektt
display: NRD90M.N920KKKS2DTJ2
fingerprint: samsung/nobleltektt/nobleltektt:7.0/NRD90M/N920KKKS2DTJ2:user/release-keys
hardware: samsungexynos7420
host: SWDH7912
isPhysicalDevice: true
manufacturer: samsung
model: SM-N920K
product: nobleltektt
tags: release-keys
type: user
versionBaseOs: samsung/nobleltektt/nobleltektt:7.0/NRD90M/N920KKKU2DRG3:user/release-keys
versionCodename: REL
versionIncremental: N920KKKS2DTJ2
versionPreviewSdk: 0
versionRelease: 7.0
versionSdk: 24
versionSecurityPatch: 2018-08-01 |
@dkwingsmt This looks like code you added recently? |
_rawKeyboard.lookUpLayout(physicalKey)!
Null check operator used on a null
_rawKeyboard.lookUpLayout(physicalKey)!`
Null check operator used on a null
_rawKeyboard.lookUpLayout(physicalKey)!`Null check operator used on a null _rawKeyboard.lookUpLayout(physicalKey)!
Yes this was added recently. Although this null assertion really should be safe. Also, although it'll be hard to pinpoint the cause without a reliable reproduction, in the future this problem will eventually be avoided since we plan to implement Android's hardware keyboard handler as a high priority task, at which time this code will no longer be called. |
@dkwingsmt nope, I never called clearKeysPressed. The only things may related with keybord:
|
I can't think of any case that the result of |
Another similar issue I encountered when developing. See the error below. The error is sometimes raised suddenly(which means I can't reproduce it), and then every keyboard input will raise the same error. I need to hot-restart to fix it. I'm not sure this is related or not. It's on macOS.
flutter doctor -v
|
There are some ways to reproduce in some environments. Using an android device via USB with scrcpy (https://github.com/Genymobile/scrcpy). Using the computer keyboard (don't happens using the android keyboard with mouse) on the TextFormField will throw "Another exception was thrown: Null check operator used on a null value". |
For anyone who can reproduce this issue, can you check if #88967 fixes the issue? |
Considering this issue fixed via #88967. Feel free to report and/or reopen if similar issues occur. |
Hi, here this issue is evident when using a notebook keyboard, after applying fixes, working flawless! (no more issues) flutter doctor -v
|
We have the same issue. I fixed it by changing the physicalKey to key
|
This bug broke my app completely on Chromebooks with physical keyboard when upgrading to Flutter 2.5.0. After upgrading to Flutter 2.5.1 it works much better but right shift and right control on the Chromebook still causes the same exception. I'm not sure why right shift/control throws this exception but left shift and left control works without exception. Other modifiers and special keys like alt, alt gr, tab, esc, media controls, backspace, dash, comma etc. does not cause the bug but right shift and right control does? Very strange. I can reproduce this with these simple steps:
I reproduced this on flutter stable 2.5.1 and beta channel (2.6.0-5.2.pre) - same result in both cases. I tried master channel too (2.6.0-12.0.pre.89) but same result there. I'm reproducing it on a Chromebook from HP, model "HP Chromebook - 14-db0004no" (link to specs here). The Chromebook runs ChromeOS 96.0.4648.0, 64 bit. Any ideas on something that I may be missing? _CastError════════ Exception caught by services library ══════════════════════════════════ When the exception was thrown, this was the stack flutter doctor -v[√] Flutter (Channel stable, 2.5.1, on Microsoft Windows [Version 10.0.19041.1237], locale sv-SE) [√] Android toolchain - develop for Android devices (Android SDK version 30.0.2) [√] Chrome - develop for the web [√] Android Studio (version 2020.3) [√] VS Code (version 1.60.2) [√] Connected device (4 available) • No issues found! |
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 |
Sorry I cannot reproduce it, it is collected from a small amount of app users' crash feedback. All are android devices.
flutter/packages/flutter/lib/src/services/hardware_keyboard.dart
Lines 889 to 896 in 338ade8
Built using
Flutter (Channel beta, 2.5.0-5.1.pre, on Microsoft Windows [Version 10.0.19043.1110], locale zh-CN)
flutter doctor -v
The text was updated successfully, but these errors were encountered: