smstuebe / xamarin-fingerprint

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

Failed to resolve type Plugin.Fingerprint.Abstractions.IFingerprint #168

Closed yyuzyk closed 2 years ago

yyuzyk commented 4 years ago

Crash during start application on iOS. Crash on MvvmCross 6. On MvvmCross 5 - works correct.

Crashlog

MvvmCross.Exceptions.MvxException: Failed to construct and initialize ViewModel for type Core.ViewModels.LoginViewModel from locator MvxDefaultViewModelLocator - check InnerException for more information ---> MvvmCross.Exceptions.MvxException: Problem creating viewModel of type LoginViewModel ---> MvvmCross.Exceptions.MvxIoCResolveException: Failed to construct LoginViewModel ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> MvvmCross.Exceptions.MvxIoCResolveException: Failed to resolve type Plugin.Fingerprint.Abstractions.IFingerprint

Configuration

Version of the Plugin: 2.0.0 - 2.1.1

Platform: iOS

Device: iPhone

MvvmCross 6.4.2

smsissuechecker commented 4 years ago

Hi @yyuzyk,

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!

S-Pourali commented 3 years ago

I faced with this issue too in MvvmCross (v 7.1.2). as MvvmCross self mentioned ,resolving with type Mvx.Resolve< Interface >(); is obsolete. current document is refered to old version of MvvmCross.

S-Pourali commented 3 years ago

Actually this is not an issue (my bad !! ), before resolving IFingerprint interface in IoC, just construct CrossFingerprint.Current using by LazyConstructAndRegisterSingleton when initialing app.

 Mvx.IoCProvider.LazyConstructAndRegisterSingleton(() => CrossFingerprint.Current);

then could resolve IFingerprint in any ViewModel or even inject it.

var isSuccess = Mvx.IoCProvider.TryResolve(out IFingerprint fpService);

thank you @smstuebe.

filipoff2 commented 3 years ago

“Dirty deeds done dirt cheap!” by Bogusław Błoński https://link.medium.com/Yg7sYwWYeeb