smstuebe / xamarin-fingerprint

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

IsAvailableAsync not working on Android (System.MissingMethodException) #68

Closed JelleDamen closed 7 years ago

JelleDamen commented 7 years ago

Steps to reproduce

Code I've been using in my mvvmcross core project:

    public IMvxCommand ContinueCommand
        {
            get
            {
                return new MvxAsyncCommand(async () =>
                {
                    var fpService = Mvx.Resolve<IFingerprint>();
                    if(await fpService.IsAvailableAsync())
                        ShowViewModel<FingerprintSetupViewModel>();
                    else
                        ShowViewModel<MainViewModel>();
                });
            }
        }

Expected behavior

I expect it to work, since it also works on iOS

Actual behavior

app crashes with the following error:


[MonoDroid] System.MissingMethodException: Method 'Plugin.Fingerprint.Abstractions.IFingerprint.IsAvailableAsync' not found.
[MonoDroid]   at System.Runtime.CompilerServices.AsyncVoidMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) [0x0002c] in <3fd174ff54b146228c505f23cf75ce71>:0 
[MonoDroid]   at myapp.Core.PincodeValidationViewModel.<get_ContinueCommand>b__10_0 () [0x00026] in <accf0a0eb910450fbc21f8bed3e5bef5>:0 

Configuration

Visual Studio for Mac (stable) Tested on Samsung Galaxy S7 and Nexus 5X MvvmCross 4.4.0 Linking: SDK only

smstuebe commented 7 years ago

Hmm. Have you updated recently? Cleaned your build correctly? Seems that there is somewhere an old version of a library

JelleDamen commented 7 years ago

I noticed that my core project was still on 1.4.3 ...oops But after updating that it still doesn't work during debug. I tried clean, removing obj/bin folders. removing and Restoring packages. Migrating both to 1.4.4. but the same error show up everytime :(

any ideas?

JelleDamen commented 7 years ago

Strange.. i did the above thing again. + removed the installed app from the device and now it does work... Thanks anyway!

smstuebe commented 7 years ago

Maybe because of fast deployment?

JelleDamen commented 7 years ago

I thought so as well, but turning it off did not fix it. I think is was some weird 'cached' state of my project. Sometimes you try so many things that you don't really realise what solved it :P

smstuebe commented 7 years ago

Main thing is: plugin works yay

rahultiwari007 commented 4 years ago

i am still facing same issue in iOS Xamarin project, Failed to resolve type Plugin.Fingerprint.Abstractions.IFingerprint

JelleDamen commented 4 years ago

@rahultiwari007 I don't think that this issue is related. Maybe it's better to open a new issue with all the information you have.