1

I'm trying to add the Hexasoft.Zxcvbn package to my Xamarin Droid project, however when I try to do so it errors:

Could not install package 'Hexasoft.Zxcvbn 1.0.2'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v7.1', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author

The source code is available on github (https://github.com/hexasoftuk/Hexasoft.Zxcvbn), so I can make any changes necessary. I'm just wondering what exactly has to be changed in order to support MonoAndroid 7.1?

enter image description here

Justin
  • 17,670
  • 38
  • 132
  • 201
  • In my short experience with xamarin, hope for the best but plan for the worst when it comes to any sort of package update. You'll have to update your version of Mono and then potentially update other dependencies for the project depending on how they react to the mono update. – victor Jul 14 '17 at 15:53
  • I have the latest updates installed for Xamarin. – Justin Jul 14 '17 at 16:02
  • well, no you dont because you dont have the most up to date version of mono or else you wouldnt be getting that error? Do you know what version of mono you are running? Maybe you do have 7.1 and its just some other xamarin problem – victor Jul 14 '17 at 16:04
  • Mono 5.0.1.1 (2017-02/5077205) (64-bit) – Justin Jul 14 '17 at 16:06
  • https://developer.xamarin.com/releases/android/xamarin.android_7/xamarin.android_7.1/ – victor Jul 14 '17 at 16:08
  • 1
    @victor the error says that "Hexasoft.Zxcvbn 1.0.2'" does not include "'MonoAndroid,Version=v7.1'". It's nothing to do with Justin mono or android version. The lib itself does not include an assembly for MonoAndroid. – Taier Jul 14 '17 at 16:10

1 Answers1

0

The author of that library does not build it with MonoAndroid assembly. You need to download a source code of that library, add it to the project and try to compile it yourself. There are some caveats, for example, if that library target framework that's not available for Xamarin.Droid, you will be forced to find them, compile and circle repeat itself...

If you don't want to compile it, you can create PCL project and try to add it there. Then, link that PCL project to your app and use it as a proxy.

EDIT 1:If you are able to compile it, just add it into your Android project: enter image description here enter image description here

EDIT 2: Then do the twist, change your PCL library to NetStandart and try to import lib again:) enter image description here

Taier
  • 2,109
  • 12
  • 22
  • Adding to a PCL project didn't work either, similar error: Could not install package 'Hexasoft.Zxcvbn 1.0.2'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.0,Profile=Profile5', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author. – Justin Jul 14 '17 at 16:17
  • @Justin sadly, the only solution for you now is to compile it yourself :) – Taier Jul 14 '17 at 16:19
  • I've downloaded it and compiled it with Visual Studio for Mac, however I'm not clear on how to target .NETPortable 4.0. The only options in the target framework are the standard .NET versions. – Justin Jul 14 '17 at 16:25
  • Doesn't work, it shows the project reference as incompatible. – Justin Jul 14 '17 at 17:20
  • .NET Standard is incompatible too. :( – Justin Jul 14 '17 at 17:40
  • well.. that this is the end :( Looks like there are dependencies that are not compiled with needed .Net – Taier Jul 14 '17 at 18:15