smstuebe / xamarin-fingerprint

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

Unable to build XForms (Portable, .NET Framework 4.5) with v1.3.0 #30

Closed aubykhan closed 7 years ago

aubykhan commented 7 years ago

It looks like the nuget is published after converting to .NET Standard and I'm not able to compile my normal PCL project (targeting .NET 4.5) after I update to v1.3.0. I need the fixes for Samsung and I can't convert the existing project to use .NET Standard libraries.

Output: 1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): warning MSB3274: The primary reference "D:\Dev\Xamarin\xamarin-fingerprint\src\Plugin.Fingerprint.Abstractions\bin\Debug\Plugin.Fingerprint.Abstractions.dll" could not be resolved because it was built against the ".NETPortable,Version=v5.0" framework. This is a higher version than the currently targeted framework ".NETPortable,Version=v4.5,Profile=Profile78".

1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): warning MSB3275: The primary reference "D:\Dev\Xamarin\xamarin-fingerprint\src\Plugin.Fingerprint\bin\Debug\Plugin.Fingerprint.dll" could not be resolved because it has an indirect dependency on the assembly "Plugin.Fingerprint.Abstractions, Version=1.3.0.0, Culture=neutral, PublicKeyToken=null" which was built against the ".NETPortable,Version=v5.0" framework. This is a higher version than the currently targeted framework ".NETPortable,Version=v4.5,Profile=Profile78".

1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): warning MSB3274: The primary reference "D:\Dev\Xamarin\xamarin-fingerprint\src\Plugin.Fingerprint\bin\Debug\Plugin.Fingerprint.dll" could not be resolved because it was built against the ".NETPortable,Version=v5.0" framework. This is a higher version than the currently targeted framework ".NETPortable,Version=v4.5,Profile=Profile78".

1>D:\Dev\Xamarin\xamarin-fingerprint\src\Sample\SMS.Fingerprint.Sample\MainView.xaml.cs(4,7,4,13): error CS0246: The type or namespace name 'Plugin' could not be found (are you missing a using directive or an assembly reference?)

1>D:\Dev\Xamarin\xamarin-fingerprint\src\Sample\SMS.Fingerprint.Sample\MainView.xaml.cs(43,43,43,74): error CS0246: The type or namespace name 'FingerprintAuthenticationResult' could not be found (are you missing a using directive or an assembly reference?)

smstuebe commented 7 years ago

Which profile has your PCL? Have you tried to remove the library and reinstall it?

aubykhan commented 7 years ago

Yes, tried multiple times. Even the sample app in this repo isn't compiling and the above output is from that too. I cloned the full repo and I'm trying to run the sample application. But compilation is failing with the output that I shared in OP

smstuebe commented 7 years ago

Is your build environment (e.g. Visual Studio) up to date? :)

aubykhan commented 7 years ago

I have Update 3 installed for VS 2015. Is the latest nuget compatible with PCLs targeting .NET 4.5? Remember that it compiles just fine when I revert back to v1.2.0.

aubykhan commented 7 years ago

See this image. Plugin.Fingerprint is targetting NETStandard but SMS.Fingerprint.Sample (PCL) is using .NET 4.5. Hence, SMS.Fingerprint.Sample fails to compile due to this I think capture

smstuebe commented 7 years ago
  1. The sample builds fine
  2. I just created a new Xamarin.Forms app (PCL Profile = 259), updated the Xamarin.Forms package and installed the plugin and it builds
  3. I just crated a PCL with profile 78 and installed the plugin and it builds.

steps 2. & 3. were performed on an other machine than that one that was used for building and coding the plugin. For this means: Something is wrong with your setup. I assume, it's just outdated.

aubykhan commented 7 years ago

Here's my version info, does it look outdated?

capture

smstuebe commented 7 years ago

Hmm looks ok. I'm not sure what else can cause your problems :/

aubykhan commented 7 years ago

Are you sure that we can reference a PCL targeting NET Standard from a PCL that references .NET Framework 4.5? I know that you can do the opposite but I'm not sure about the above scenario.

aubykhan commented 7 years ago

The problem persists even if a create a brand new XForms project and add plugin.fingerprint nuget.

smstuebe commented 7 years ago

See: https://github.com/dotnet/corefx/blob/master/Documentation/architecture/net-platform-standard.md#portable-profiles

PCL projects will be able to consume packages built for .NET Platform Standard (netstandard1.x)

Since the Plugin uses netstandard1.0, it is working fine :)

aubykhan commented 7 years ago

There was a pending patch for VS2015. After updating, it works! Thanks for your support.