smstuebe / xamarin-fingerprint

Xamarin and MvvMCross plugin for authenticate a user via fingerprint sensor
Microsoft Public License
490 stars 115 forks source link

androidx.core.app.CoreComponentFactory.instantiateActivity java.lang.InstantiationException: java.lang.Class<androidx.biometric.DeviceCredentialHandlerActivity> cannot be instantiated #191

Closed lbolanos closed 3 years ago

lbolanos commented 3 years ago

We are facing this crash reports using version less than o equal 9 android. In debug the crash is not happening. Just in release

Thanks in advance


## Steps to reproduce

1.

public class EmployActivity : AppCompatActivity, ILocationListener, IGPSCameraCallBack, IFFCallBack
    {...
protected async override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            //CrossFingerprint.SetCurrentActivityResolver(() => CrossCurrentActivity.Current.Activity);
            CrossFingerprint.SetCurrentActivityResolver(() => this);
            var availability = await CrossFingerprint.Current.GetAvailabilityAsync();
await CrossFingerprint.Current.IsAvailableAsync(true)
fingerButton.Click += async delegate
            {
var result = await CrossFingerprint.Current.AuthenticateAsync(dialogConfig, _cancel.Token);
                await SetResultAsync(result);

Expected behavior

No Crash

Actual behavior

Crash

Crashlog

java.lang.Class.newInstance Class.java android.app.AppComponentFactory.instantiateActivity AppComponentFactory.java:69 androidx.core.app.CoreComponentFactory.instantiateActivity android.app.Instrumentation.newActivity Instrumentation.java:1216

android.app.ActivityThread.performLaunchActivity ActivityThread.java:2876 android.app.ActivityThread.handleLaunchActivity ActivityThread.java:3081 android.app.servertransaction.LaunchActivityItem.execute LaunchActivityItem.java:78 android.app.servertransaction.TransactionExecutor.executeCallbacks TransactionExecutor.java:108 android.app.servertransaction.TransactionExecutor.execute TransactionExecutor.java:68 android.app.ActivityThread$H.handleMessage ActivityThread.java:1831

Configuration

**Version of the Plugin: 2.1.1

**Platform: Android <= 9

smsissuechecker commented 3 years ago

Hi @lbolanos,

I'm the friendly issue checker. It seems like (37.50 %) you haven't used our issue template :cry: I think it is very frustrating for the repository owners, if you ignore them.

If you think it's fine to make an exception, just ignore this message. But if you think it was a mistake to delete the template, please close the issue and create a new one.

Thanks!

lbolanos commented 3 years ago

I think i discover the problem. I had set Code Shrinker=r8 Remove it and it works