The “offending” line is simply:
BiometricAuthenticationResult authResult = await biometricAuthenticationService.AuthenticateAsync(“Login”, “Some prompt goes here.”);
In our demo it works and shows the popup.
In our solution, targeting net 6.0, fails with this complete error message:
System.TypeLoadException: ‘Could not load type of field ‘Plugin.Fingerprint.FingerprintImplementation+d__5:<>u__2’ (11) due to: Could not resolve type with token 01000035 from typeref (expected class ‘System.Runtime.CompilerServices.ValueTaskAwaiter’ in assembly ‘mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e’) assembly:mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e type:System.Runtime.CompilerServices.ValueTaskAwaiter member:(null)’
All other things are equal between the two projects (Demo and our actual solution):
Version of the Plugin.Fingerprint:
2.1.5
In AndroidManifest.xaml:
uses-permission android:name=”android.permission.USE_BIOMETRIC”
and
uses-permission android:name=”android.permission.USE_FINGERPRINT”
In MauiProgram.cs:
builder.Services.AddSingleton<IBiometricAuthenticationService, BiometricAuthenticationService>();
Thank you
Alex