Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
679 views
in Technique[技术] by (71.8m points)

xamarin.android - Xamarin Android Build Errors After Adding MvvmCross.Plugins.Fingerprint Package 2.1.3

I need help. Again and again.

My app was building and running fine after migrating to AndroidX. I need to implement Biometrics, so I installed MvvmCross.Plugins.Fingerprint. Now I get 3 errors:

  1. 'Mvx' does not contain a definition for 'Warning' (CS0117)
  2. 'Resource' does not contain a definition for 'Layout' (CS0117)
  3. 'Resource.Id' does not contain a definition for 'text1' (CS0117)

I'm going to post this on the GitHub page for the package too.

I googled all of errors, but nothing looks promising.

Thanks! Larry

enter image description here

question from:https://stackoverflow.com/questions/65893918/xamarin-android-build-errors-after-adding-mvvmcross-plugins-fingerprint-package

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The issue is most likely that the plugin is targeting MvvmCross 6.0.0, while you are on 7.x.x since you are mentioning AndroidX.

The MvvmCross.Plugins.Fingerprint package doesn't much else than just registering the Fingerprint in the IoC container for you.

So instead try just adding the Plugin.Fingerprint package to your project. Then in Setup.cs you can register this yourself in a override of InitializeLastChance or any other relevant lifecycle method there:

protected override void InitializeLastChance()
{
    base.InitializeLastChance();

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

Now you can resolve IFingerprint in your ViewModels.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...