xamarin-fingerprint icon indicating copy to clipboard operation
xamarin-fingerprint copied to clipboard

Authentication failed with message "FragmentManager is already executing transactions"

Open filipleifer opened this issue 4 years ago • 11 comments

When Fingerprint plugin is not used on first page pushed into Navigation (NextPage in Demo) then you will get unexpected result if you try to await authentication result. If you use it on first page which is pushed into navigation (MainPage in Demo) the behaviour is correct. Demo app:

FingerPrintBugDemo.zip

Steps to reproduce

  1. Run demo app in Debug on Android device, set breakpoint to line 29 of NextPage.xaml.cs
  2. Click on button "Click" on MainPage.
  3. You get false authentication result with message "FragmentManager is already executing transactions" but fingeprint dialog is diplayed and awaiting your input in line 29 of NextPage.xaml.cs

Expected behavior

You will be awaiting the real fingerprint dialog result.

Actual behavior

You get false authentication result without wait on real result with message "FragmentManager is already executing transactions" but fingeprint dialog is still diplayed and awaiting your input.

Configuration

Version of the Plugin: Latest 2.1.2

Platform: Android 8.0 / Android 9.0

Device: Huawei P20 Lite ANE-LX1 / Sony Xperia XZ1 G8342

filipleifer avatar Nov 30 '20 12:11 filipleifer

Hi @filipleifer,

I'm the friendly issue checker. Thanks for using the issue template :star2: I appreciate it very much. I'm sure, the maintainers of this repository will answer, soon.

smsissuechecker avatar Nov 30 '20 12:11 smsissuechecker

Also experiencing this issue on Android 10, using latest 2.1.3

rj-thomas avatar Dec 20 '20 22:12 rj-thomas

I too faced this issue

kgbuddhima avatar Feb 02 '21 07:02 kgbuddhima

I'm having the same issue, Android 11

wstanczewski avatar Mar 09 '21 15:03 wstanczewski

I think this issue is a duplicate of #182

wstanczewski avatar Mar 09 '21 15:03 wstanczewski

Using this plugin like that: var result = await Device.InvokeOnMainThreadAsync(() => CrossFingerprint.Current.AuthenticateAsync(new("",""))) solves the issue :)

wstanczewski avatar Mar 09 '21 15:03 wstanczewski

I have the same issue and @wstanczewski's solution is not working for me.
As a workaround I wait 500ms before calling AuthenticateAsync and it's working.

await Task.Delay(500);
var result = await Plugin.Fingerprint.CrossFingerprint.Current.AuthenticateAsync([...]);

Ulrizza avatar Apr 01 '21 11:04 Ulrizza

Using this plugin like that: var result = await Device.InvokeOnMainThreadAsync(() => CrossFingerprint.Current.AuthenticateAsync(new("",""))) solves the issue :)

We tried this process, it worked with debug mode but it's not working in the release mode, Authentication process is not invoked. If any one has any suggestion, any help is appreciated

maheshkumar1989 avatar Feb 07 '22 14:02 maheshkumar1989

I have the same issue and @wstanczewski's solution is not working for me. As a workaround I wait 500ms before calling AuthenticateAsync and it's working.

await Task.Delay(500);
var result = await Plugin.Fingerprint.CrossFingerprint.Current.AuthenticateAsync([...]);

We tried this process. It's not working. Authentication process is not invoked. If any one has any suggestion, any help is appreciated.

maheshkumar1989 avatar Feb 07 '22 14:02 maheshkumar1989

I have the same issue and @wstanczewski's solution is not working for me. As a workaround I wait 500ms before calling AuthenticateAsync and it's working.

await Task.Delay(500);
var result = await Plugin.Fingerprint.CrossFingerprint.Current.AuthenticateAsync([...]);

This is the only solution that worked. Observed that stepping thru code and waiting for a second in the debugger doesn't throw the error. Hacky, but works.

IDispose avatar Jan 25 '23 12:01 IDispose