Skip to content
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

[local_auth] [android] NPE on BiometricPrompt$ButtonInfo.executor when canceling auth on Samsung SM F711B #104489

Open
alhappler opened this issue May 24, 2022 · 9 comments
Labels
c: crash Stack traces logged to the console c: fatal crash Crashes that terminate the process e: device-specific Only manifests on certain devices e: samsung Issues only reproducible on Samsung devices p: local_auth Plugin for local authentification P2 Important issues not at the top of the work list package flutter/packages repository. See also p: labels. platform-android Android applications specifically team-android Owned by Android platform team triaged-android Triaged by Android platform team

Comments

@alhappler
Copy link

the method authenticate of local_auth crashes on Samsung SM F711B.

Steps to Reproduce

(using example App of 2.10 )

  • authenticate
  • select face
  • successfully detect face
  • cancel authenticate Popup

Expected Result

should not crash

Logs

Logs
I/BufferQueueProducer(28871): [SurfaceView - io.flutter.plugins.localauthexample/io.flutter.embedding.android.FlutterFragmentActivity@f50c179@0#1(BLAST Consumer)1](id:70c700000001,api:1,p:28871,c:28871) queueBuffer: queued for the first time.
I/SurfaceView@f50c179(28871): uSP: rtp = Rect(0, 0 - 1080, 2496) rtsw = 1080 rtsh = 2496
I/SurfaceView@f50c179(28871): onSSPAndSRT: pl = 0 pt = 0 sx = 1.0 sy = 1.0
I/SurfaceView@f50c179(28871): aOrMT: uB = true t = android.view.SurfaceControl$Transaction@c012bda fN = 1 android.view.SurfaceView.access$500:124 android.view.SurfaceView$SurfaceViewPositionUpdateListener.positionChanged:1728 android.graphics.RenderNode$CompositePositionUpdateListener.positionChanged:319 
I/SurfaceView@f50c179(28871): aOrMT: vR.mWNT, vR = ViewRootImpl@27c5ca5[FlutterFragmentActivity]
I/ViewRootImpl@27c5ca5[FlutterFragmentActivity](28871): mWNT: t = android.view.SurfaceControl$Transaction@c012bda fN = 1 android.view.SurfaceView.applyOrMergeTransaction:1628 android.view.SurfaceView.access$500:124 android.view.SurfaceView$SurfaceViewPositionUpdateListener.positionChanged:1728 
I/ViewRootImpl@27c5ca5[FlutterFragmentActivity](28871): mWNT: merge t to BBQ
I/BufferQueueProducer(28871): [ViewRootImpl@27c5ca5[FlutterFragmentActivity]#0(BLAST Consumer)0](id:70c700000000,api:1,p:28871,c:28871) queueBuffer: queued for the first time.
D/OpenGLRenderer(28871): GPIS:: SetUp Pid : 28871    Tid : 28899
I/ViewRootImpl@27c5ca5[FlutterFragmentActivity](28871): [DP] pdf(0) 1 android.view.ViewRootImpl.lambda$addFrameCompleteCallbackIfNeeded$3$ViewRootImpl:4969 android.view.ViewRootImpl$$ExternalSyntheticLambda16.run:6 android.os.Handler.handleCallback:938 
I/ViewRootImpl@27c5ca5[FlutterFragmentActivity](28871): [DP] rdf()
D/ViewRootImpl@27c5ca5[FlutterFragmentActivity](28871): reportDrawFinished (fn: -1) 
I/ViewRootImpl@27c5ca5[FlutterFragmentActivity](28871): MSG_WINDOW_FOCUS_CHANGED 1 1
D/InputMethodManager(28871): startInputInner - Id : 0
I/InputMethodManager(28871): startInputInner - mService.startInputOrWindowGainedFocus
D/InputMethodManager(28871): startInputInner - Id : 0
I/ViewRootImpl@27c5ca5[FlutterFragmentActivity](28871): ViewPostIme pointer 0
I/ViewRootImpl@27c5ca5[FlutterFragmentActivity](28871): ViewPostIme pointer 1
I/ViewRootImpl@27c5ca5[FlutterFragmentActivity](28871): MSG_WINDOW_FOCUS_CHANGED 0 1
D/InputTransport(28871): Input channel destroyed: 'ClientS', fd=117
I/BiometricPrompt(28871): onDialogDismissed: 2
W/Binder  (28871): Caught a RuntimeException from the binder stub implementation.
W/Binder  (28871): java.lang.NullPointerException: Attempt to read from field 'java.util.concurrent.Executor android.hardware.biometrics.BiometricPrompt$ButtonInfo.executor' on a null object reference
W/Binder  (28871): 	at android.hardware.biometrics.BiometricPrompt$1.onDialogDismissed(BiometricPrompt.java:705)
W/Binder  (28871): 	at android.hardware.biometrics.IBiometricServiceReceiver$Stub.onTransact(IBiometricServiceReceiver.java:174)
W/Binder  (28871): 	at android.os.Binder.execTransactInternal(Binder.java:1220)
W/Binder  (28871): 	at android.os.Binder.execTransact(Binder.java:1179)
I/ViewRootImpl@27c5ca5[FlutterFragmentActivity](28871): MSG_WINDOW_FOCUS_CHANGED 1 1
D/InputMethodManager(28871): startInputInner - Id : 0
I/InputMethodManager(28871): startInputInner - mService.startInputOrWindowGainedFocus

@huycozy huycozy added the in triage Presently being triaged by the triage team label May 24, 2022
@huycozy
Copy link
Member

huycozy commented May 24, 2022

Hi @alhappler, can you provide flutter doctor -v?
I tried to reproduce the issue on another device, the steps are different than yours.

1. Click on Authenticate button
2. Successfully detect face
3. Authorized and there is no authentication popup there and I can not click `cancel` as your step

So it'll be great if you could provide us a recorded video for this issue by a specific device.

Thanks.

@huycozy huycozy added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 24, 2022
@alhappler
Copy link
Author

@huycozy of course

The device blocks any form of screenrecord or screenshot so here is a crappy video:

demo.mp4

flutter doctor

flutter doctor ``` [✓] Flutter (Channel stable, 2.10.5, on macOS 12.3.1 21E258 darwin-x64, locale en-GB) • Flutter version 2.10.5 at /Users/[XXX]/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 5464c5b (5 weeks ago), 2022-04-18 09:55:37 -0700 • Engine revision 57d3bac3dd • Dart version 2.16.2 • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/[XXX]/Library/Android/sdk
• Platform android-31, build-tools 31.0.0
• ANDROID_HOME = /Users/[XXX]/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.4)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.3

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

[✓] Android Studio (version 2021.2)
• 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 11.0.12+0-b1504.28-7817840)

[✓] VS Code (version 1.67.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (3 available)
• iPad Air (4th generation) (mobile) • 9D56B597-8082-44BF-82FA-A4BDAD927F4E • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-0 (simulator)
• iPhone 12 (mobile) • D3292DBE-DD1E-4907-924B-01FD0536AD10 • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-5 (simulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 101.0.4951.64

[✓] HTTP Host Availability
• All required HTTP hosts are available

• No issues found!

</details>

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 24, 2022
@huycozy
Copy link
Member

huycozy commented May 24, 2022

Hi, thanks for the quick response. As far as I can see, you are using the old flutter version, the latest version now is 3.0.1 stable. Can you please upgrade SDK and then try again?

@huycozy huycozy added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 24, 2022
@alhappler
Copy link
Author

Hey, @huycozy
I upgraded to 3.0.1, same result

flutter doctor

flutter doctor [✓] Flutter (Channel stable, 3.0.1, on macOS 12.3.1 21E258 darwin-x64, locale en-GB) • Flutter version 3.0.1 at /Users/[XXX]/fvm/versions/3.0.1 • Upstream repository https://github.com/flutter/flutter.git • Framework revision fb57da5 (5 days ago), 2022-05-19 15:50:29 -0700 • Engine revision caaafc5604 • Dart version 2.17.1 • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/[XXX]/Library/Android/sdk
• Platform android-31, build-tools 31.0.0
• ANDROID_HOME = /Users/[XXX]/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.4)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.3

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

[✓] Android Studio (version 2021.2)
• 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 11.0.12+0-b1504.28-7817840)

[✓] VS Code (version 1.67.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (5 available)
• SM F711B (mobile) • R5CRA1159SW • android-arm64 • Android 12 (API 31)
• iPad Air (4th generation) (mobile) • 9D56B597-8082-44BF-82FA-A4BDAD927F4E • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-0 (simulator)
• iPhone 12 (mobile) • D3292DBE-DD1E-4907-924B-01FD0536AD10 • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-5 (simulator)
• macOS (desktop) • macos • darwin-x64 • macOS 12.3.1 21E258 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 101.0.4951.64

[✓] HTTP Host Availability
• All required HTTP hosts are available

• No issues found!

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 24, 2022
@huycozy
Copy link
Member

huycozy commented May 25, 2022

Hi, I’m unable to reproduce the issue due to no similar device. I will keep this issue open for further investigation.

@huycozy huycozy added c: crash Stack traces logged to the console e: device-specific Only manifests on certain devices platform-android Android applications specifically plugin p: local_auth Plugin for local authentification e: samsung Issues only reproducible on Samsung devices and removed in triage Presently being triaged by the triage team labels May 25, 2022
@stuartmorgan stuartmorgan changed the title [local_auth] [android] RuntimeException on Samsung SM F711B [local_auth] [android] NPE on BiometricPrompt$ButtonInfo.executor when canceling auth on Samsung SM F711B May 26, 2022
@stuartmorgan stuartmorgan added c: fatal crash Crashes that terminate the process P2 Important issues not at the top of the work list labels May 26, 2022
@sureace
Copy link

sureace commented Jun 8, 2022

Hi,
I am also facing similar issue in samsung devices. Please check the logs below
I/BiometricPrompt(21832): onDialogDismissed: 2
W/Binder (21832): Caught a RuntimeException from the binder stub implementation.
W/Binder (21832): java.lang.NullPointerException: Attempt to read from field 'java.util.concurrent.Executor android.hardware.biometrics.BiometricPrompt$ButtonInfo.executor' on a null object reference
W/Binder (21832): at android.hardware.biometrics.BiometricPrompt$1.onDialogDismissed(BiometricPrompt.java:705)
W/Binder (21832): at android.hardware.biometrics.IBiometricServiceReceiver$Stub.onTransact(IBiometricServiceReceiver.java:174)

Thanks

@sureace
Copy link

sureace commented Jun 9, 2022

Hi, I am also facing similar issue in samsung devices. Please check the logs below I/BiometricPrompt(21832): onDialogDismissed: 2 W/Binder (21832): Caught a RuntimeException from the binder stub implementation. W/Binder (21832): java.lang.NullPointerException: Attempt to read from field 'java.util.concurrent.Executor android.hardware.biometrics.BiometricPrompt$ButtonInfo.executor' on a null object reference W/Binder (21832): at android.hardware.biometrics.BiometricPrompt$1.onDialogDismissed(BiometricPrompt.java:705) W/Binder (21832): at android.hardware.biometrics.IBiometricServiceReceiver$Stub.onTransact(IBiometricServiceReceiver.java:174)

Thanks

If we set biometricOnly as true that means disable pin, passcode or pattern, it is not crashing.

@EB-Plum
Copy link

EB-Plum commented Jul 22, 2022

https://issuetracker.google.com/issues/211696108?pli=1

seems related issue.

@godilite
Copy link

godilite commented Oct 3, 2022

temporary workaround.
set options sensitiveTransaction to false this will hide the confirm or cancel dialog and no need to give the user cancel options

 final result = await _localAuthentication.authenticate(
      localizedReason: reason,
      options: const AuthenticationOptions(
        sensitiveTransaction: false,
      ),
    );

@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
@Hixie Hixie removed the plugin label Jul 6, 2023
@flutter-triage-bot flutter-triage-bot bot added multiteam-retriage-candidate team-android Owned by Android platform team labels Jul 8, 2023
@flutter-triage-bot flutter-triage-bot bot added the triaged-android Triaged by Android platform team label Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: crash Stack traces logged to the console c: fatal crash Crashes that terminate the process e: device-specific Only manifests on certain devices e: samsung Issues only reproducible on Samsung devices p: local_auth Plugin for local authentification P2 Important issues not at the top of the work list package flutter/packages repository. See also p: labels. platform-android Android applications specifically team-android Owned by Android platform team triaged-android Triaged by Android platform team
Projects
None yet
Development

No branches or pull requests

7 participants