Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to load skiasharp assemblies #64

Open
mced76 opened this issue Nov 11, 2020 · 5 comments
Open

unable to load skiasharp assemblies #64

mced76 opened this issue Nov 11, 2020 · 5 comments

Comments

@mced76
Copy link

mced76 commented Nov 11, 2020

Hello,

In my Xamarin project, I have microcharts component which reference skiasharp assembly.

When I launch the unit test, App.init crash in the form creator "Could not load file or assembly 'SkiaSharp.Views.Forms, Version=2.80.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.\n"
The skiasharp is here but I think that no plateform is defined in unit test and all the skiasharp component crash.

Have-you any idea to resolve it ?

(Xamarin.forms 4.8, VS 2019 - Mac, NUnit)

Thx

@jonathanpeppers
Copy link
Owner

Can you share the code for the test that's failing?

Or one better, can you add a new SkiaSharpTests that shows the problem in the project here:

https://github.com/jonathanpeppers/Xamarin.Forms.Mocks/tree/master/Xamarin.Forms.Mocks.Tests

Thanks!

@mced76
Copy link
Author

mced76 commented Nov 25, 2020

Sorry, I was very busy last week. I have added the Skiasharp Test in the project.

Thanks!

@jonathanpeppers
Copy link
Owner

If you go here and download the .nupkg file:

https://www.nuget.org/packages/SkiaSharp.Views.Forms/2.80.2

There is no SkiaSharp.Views.Forms.dll that would work in a unit test project:

image

We would need a net462 assembly or something for this to work in unit tests... This folder is empty.

As far as SkiaSharp.Views.Forms is concerned, it doesn't actually work on a platform that it doesn't have an assembly for.

@JanettHolst290490
Copy link

Is there a workaround ? I just need the CodeBehind to work, not the actual Xaml elements.

@jonathanpeppers
Copy link
Owner

If the error is: "Could not load file or assembly 'SkiaSharp.Views.Forms, Version=2.80.0.0, Culture=neutral, PublicKeyToken=null'.

You could try unzipping the .nupkg and referencing the netstandard2.0 assembly directly. If anything calls into it, you'll hit a NotImplementedException, though.

So I'm not sure how useful this workaround would actually be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants