smstuebe / xamarin-fingerprint

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

No field mLifecycleObserver in class Landroidx/biometric/BiometricPrompt; #203

Open ronpf opened 3 years ago

ronpf commented 3 years ago

To help us fix your issue, please provide the information in the below template. If something causes a crash, provide as much information as you can gather. Just imagine: we do not know what you are doing!

Note: There is often little we can do without a minimal reproducible sample of the issue, so please provide that in a standalone git repository and link it here.

Steps to reproduce

  1. Install Plugin.Fingerprint 2.1.3, Xamarin.Forms 5.0.0.1931

  2. Copy code from Android example in this repo

  3. Run on real device, simulator API 28 or API29

Expected behavior

Fingerprint authentication performs as designed with no errors

Actual behavior

After return of "await CrossFingerprint.Current.AuthenticateAsync(request);" I'm receiving a result of FingerprintAuthenticationResultStatus.UnknownError

result.ErrorMessage= "No field mLifecycleObserver in class Landroidx/biometric/BiometricPrompt; (declaration of 'androidx.biometric.BiometricPrompt' appears in /data/app/com.[ my package ] .droid-[ my package info ]==/base.apk)"

Crashlog

[ViewRootImpl@307ba2f[MainActivity]] ViewPostIme pointer 0 [ViewRootImpl@307ba2f[MainActivity]] ViewPostIme pointer 1 [BiometricPrompt] Preferred type = 1 [BiometricPrompt] handlePreAuthenticationErrors : 1 [BiometricPrompt] Preferred type = 1 [BiometricPrompt] handlePreAuthenticationErrors : 1 [InputMethodManager] prepareNavigationBarInfo() DecorView@c23d073[MainActivity] [InputMethodManager] getNavigationBarColor() -855310 [InputMethodManager] Starting input: tba=com.hpsj.memberportal.droid ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false [InputMethodManager] startInputInner - Id : 0 [InputMethodManager] startInputInner - mService.startInputOrWindowGainedFocus [InputTransport] Input channel destroyed: fd=91 [ViewRootImpl@307ba2f[MainActivity]] MSG_WINDOW_FOCUS_CHANGED 0 1 [InputMethodManager] prepareNavigationBarInfo() DecorView@c23d073[MainActivity] [InputMethodManager] getNavigationBarColor() -855310 [ViewRootImpl@307ba2f[MainActivity]] MSG_WINDOW_FOCUS_CHANGED 1 1 [InputMethodManager] prepareNavigationBarInfo() DecorView@c23d073[MainActivity] [InputMethodManager] getNavigationBarColor() -855310 Thread started: #20 [InputMethodManager] prepareNavigationBarInfo() DecorView@c23d073[MainActivity] [InputMethodManager] getNavigationBarColor() -855310 [InputMethodManager] Starting input: tba=com.hpsj.memberportal.droid ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false [InputMethodManager] startInputInner - Id : 0 [InputMethodManager] startInputInner - mService.startInputOrWindowGainedFocus [InputTransport] Input channel constructed: fd=91 RETURNED FROM CrossFingerprint.Current.AuthenticateAsync() [Dialog] mIsSamsungBasicInteraction = false [Dialog] mIsSamsungBasicInteraction = false, isMetaDataInActivity = false [DecorView] createDecorCaptionView >> DecorView@7f2db77[], isFloating: true, isApplication: true, hasWindowDecorCaption: false, hasWindowControllerCallback: false [ScrollView] initGoToTop [InputTransport] Input channel constructed: fd=82 [ViewRootImpl@2d7e4b2[Fingerprint]] setView = DecorView@7f2db77[Fingerprint] TM=true MM=false [ViewRootImpl@2d7e4b2[Fingerprint]] dispatchAttachedToWindow [ViewRootImpl@2d7e4b2[Fingerprint]] Relayout returned: old=[0,84][1440,2792] new=[37,1092][1403,1783] result=0x7 surface={valid=true 3516878848} changed=true [OpenGLRenderer] eglCreateWindowSurface = 0xcedaf920, 0xd19f5008 [ScrollView] onsize change changed [ViewRootImpl@2d7e4b2[Fingerprint]] MSG_WINDOW_FOCUS_CHANGED 1 1 [ViewRootImpl@2d7e4b2[Fingerprint]] MSG_RESIZED: frame=Rect(37, 1092 - 1403, 1783) ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1 [ViewRootImpl@307ba2f[MainActivity]] MSG_WINDOW_FOCUS_CHANGED 0 1 [InputMethodManager] prepareNavigationBarInfo() DecorView@c23d073[MainActivity] [InputMethodManager] getNavigationBarColor() -855310 [ViewRootImpl@2d7e4b2[Fingerprint]] ViewPostIme pointer 0 [ViewRootImpl@2d7e4b2[Fingerprint]] ViewPostIme pointer 1 [OpenGLRenderer] eglDestroySurface = 0xcedaf920, 0xd19f5000 [OpenGLRenderer] endAllActiveAnimators on 0xcaa4a900 (RippleDrawable) with handle 0xcd31f480 [ViewRootImpl@2d7e4b2[Fingerprint]] dispatchDetachedFromWindow [ViewRootImpl@2d7e4b2[Fingerprint]] Surface release. android.view.ViewRootImpl.doDie:7967 android.view.ViewRootImpl.die:7935 android.view.WindowManagerGlobal.removeViewLocked:497 android.view.WindowManagerGlobal.removeView:435 android.view.WindowManagerImpl.removeViewImmediate:124 android.app.Dialog.dismissDialog:518 android.app.Dialog.dismiss:501 androidx.appcompat.app.AppCompatDialog.dismiss:140 [InputTransport] Input channel destroyed: fd=82 [ViewRootImpl@307ba2f[MainActivity]] MSG_WINDOW_FOCUS_CHANGED 1 1 [InputMethodManager] prepareNavigationBarInfo() DecorView@c23d073[MainActivity] [InputMethodManager] getNavigationBarColor() -855310 [ViewRootImpl] sendUserActionEvent() returned.

If something causes an exception paste full stack trace + Exception here It does not crash or throw an exception. The result.Status is set to FingerprintAuthenticationResultStatus.UnknownError and the program continues.

Configuration

Version of the Plugin: 2.1.3

Platform: e.g. iOS Android 9 & 10

Device: e.g. Android Simulators and real devices (Samsung Note 10)

smsissuechecker commented 3 years ago

Hi @ronpf,

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.

Seuleuzeuh commented 3 years ago

I encounter the same problem on Android 11, API 30. @ronpf did you find a workaround ?

ronpf commented 3 years ago

@seuleuzeuh No I have not


From: Morgan SOULLEZ notifications@github.com Sent: Thursday, February 18, 2021 5:58:23 AM To: smstuebe/xamarin-fingerprint xamarin-fingerprint@noreply.github.com Cc: Ron Freschi RFreschi@hpsj.com; Mention mention@noreply.github.com Subject: Re: [smstuebe/xamarin-fingerprint] No field mLifecycleObserver in class Landroidx/biometric/BiometricPrompt; (#203)

I encounter the same problem on Android 11, API 30. @ronpfhttps://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fronpf&data=04%7C01%7Crfreschi%40hpsj.com%7C9a08bbbb2c0e4913a5d708d8d415426b%7C4e7c663957a340889adea0b0ff6f68ac%7C0%7C0%7C637492535068133736%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9w%2BkKv3ge8mHRdqdqD9oI5MgIXR2Sb4KVEB117miwTo%3D&reserved=0 did you find a workaround ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fsmstuebe%2Fxamarin-fingerprint%2Fissues%2F203%23issuecomment-781361625&data=04%7C01%7Crfreschi%40hpsj.com%7C9a08bbbb2c0e4913a5d708d8d415426b%7C4e7c663957a340889adea0b0ff6f68ac%7C0%7C0%7C637492535068143689%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Zwo6Mz6823zKIpiWD4iBNCOoCw92EDI9WTunqnXHPMk%3D&reserved=0, or unsubscribehttps://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABHOCKQUI7G2PT7ELXOMWADS7UMH7ANCNFSM4XRM3BRQ&data=04%7C01%7Crfreschi%40hpsj.com%7C9a08bbbb2c0e4913a5d708d8d415426b%7C4e7c663957a340889adea0b0ff6f68ac%7C0%7C0%7C637492535068143689%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=umJ4klJ3MnbcVZFPRQsS8IqlWEwWJIPoSuOTBJeONh8%3D&reserved=0.

Confidentiality Notice This message (including attachments) contains confidential information intended for the person or entity to which it is addressed. Any dissemination, copying, or distribution of this message is strictly prohibited. If you have received this message in error, please notify us immediately and delete this message. Failure to maintain confidentiality or unauthorized re-disclosure could subject you to federal and state penalties.

mshuf commented 3 years ago

@Seuleuzeuh @ronpf

I've experienced the same issue and had success with restoring functionality by downgrading Xamarin.AndroidX.Biometric from version 1.1.0 to 1.0.1.6.

Hope this helps in the meantime until we have a permanent fix.

EDIT: I've just forked off this repo and made the required changes to use the latest Xamarin.AndroidX.Biometric version 1.1.0. It was pretty simple and only required one code line change due to the updated package. I'll see if I can do a pull request and have my changes merged in, unless one of the maintainers beats me to it.

ronpf commented 3 years ago

Ok, thanks a lot! I'm sure you'll keep us in the loop with the pull request status.

Deepfreezed commented 3 years ago

Same issue. There are few issues here. Updating to Xamarin.AndroidX.Biometric 1.1.0 does not fix it.

Issue 1: Android FingerprintImplementation > TryReleaseLifecycleObserver is the method that is throwing the error. There is a note by the author on this that it will have to be revisited once Xamarin.AndroidX.Biometric is updated. You can put a try catch block in there to catch NoSuchFieldException or remove it if the issue has been fixed.

Issue 2: Xamarin.AndroidX.Biometric 1.1.0.1 is broken with a typo (Issue). You will run into issues on production release. Production release Linker is failing when set to "Sdk Assemblies Only". Last working version is Xamarin.AndroidX.Biometric 1.1.0.

smstuebe commented 3 years ago

206 was pushed in version 2.1.4 to nuget.