How do I get SkiaSharp to build now I have updated Xamarin

I have just been forced to get the latest Xamarin update (4.5.0.475) in Visual Studio 2015 because of the bug in yesterday's release (4.5.0.443). I have also updated Xamarin.Forms via nugget to V 2.3.4.247. I tried to update SkiaSharp to 1.58.0 at the same time but this now fails. Trying to go back to 1.57.1 also now fails with the same error message:

Package 'SkiaSharp.Views.1.57.1 : SkiaSharp [1.57.1, )' does not exist in folder 'D:\Data\Work\Dev\Projects\Live\MyProject\packages'
Could not install package 'SkiaSharp.Views 1.57.1'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile111', 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.

As things stand, this is a show-stopper, so I'd be very grateful if anyone knows how I might be able to fix this.

I am going to try getting a previous version of Xamarin.Forms, but my real question is: what are the 'normal' targets for a Xamarin.Forms project? I currently have: .NET Framework 4.5, ASP.NET Core 1.0, Windows 8, Windows Phone 8.1, Xamarin.Android, Xamarin.iOS, Xamarin.iOS (Classic), Xamarin.Mac.

I was going to experiment with changing the .Net Framework to 4.5.1 or 4.6 but apparently I have to uninstall all nuget packages first. Before I proceed with this painful process, could anyone offer any advice about whether I am barking up the wrong tree here?

Any help at all would be very gratefully received.

Kind wishes ~ Patrick

Best Answer

  • mattleibowmattleibow ZA Xamurai
    edited May 2017 Accepted Answer

    Here is the GitHub issue:
    https://github.com/mono/SkiaSharp/issues/301

    The package that you are trying to install SkiaSharp.Views. That package is not meant to be installed into a PCL as that is platform-specific.

    For a PCL, you just need to install the SkiaSharp and SkiaSharp.Views.Forms packages. For each app project, you should be able to install the same, but then NuGet will automatically pull in the SkiaSharp.Views package as well.

    • SkiaSharp - the drawing engine
    • SkiaSharp.Views - the platform-specific UI elements
    • SkiaSharp.Views.Forms - Xamarin.Forms UI and types

Answers

  • mattleibowmattleibow ZAXamarin Team Xamurai
    edited May 2017 Accepted Answer

    Here is the GitHub issue:
    https://github.com/mono/SkiaSharp/issues/301

    The package that you are trying to install SkiaSharp.Views. That package is not meant to be installed into a PCL as that is platform-specific.

    For a PCL, you just need to install the SkiaSharp and SkiaSharp.Views.Forms packages. For each app project, you should be able to install the same, but then NuGet will automatically pull in the SkiaSharp.Views package as well.

    • SkiaSharp - the drawing engine
    • SkiaSharp.Views - the platform-specific UI elements
    • SkiaSharp.Views.Forms - Xamarin.Forms UI and types
  • EasyGoingPatEasyGoingPat GBMember ✭✭✭

    @mattleibow I had recently managed to work that out for myself. Unfortunately never found the issue (need to brush up my search skills). Thank you for the help.

    • Patrick
Sign In or Register to comment.