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

[BUG] (Regression) SkiaSharp.Views.Forms nuget package doesn't provide anymore netstandard binaries #1047

Closed
knocte opened this issue Dec 3, 2019 · 7 comments

Comments

@knocte
Copy link

knocte commented Dec 3, 2019

Description

I tried to upgrade from SkiaSharp.Views.Forms 1.68.0 to 1.68.1 but I couldn't because the former provided a lib/netstandard1.3 folder, while the new version doesn't provide any netstandard libs (I only see folders MonoAndroid, Xamarin.Mac20, Xamarin.iOS, tizen40 and uap10.0).

(FYI I need this to be able to run a Xamarin.Forms app under GTK platform, i.e. Linux)

@lothargrieb
Copy link

I have almost similar problem.
Since moving from 1.68.01 to 1.68.1, I cannot override SKCanvasViewRendererBase at the UWP project. Decompiling points me always to the Mono version.

@mattleibow
Copy link
Contributor

@knocte The netstandard library is actually moved to the ref folder so that the compiler never copies it to the device. It was done to solve #1011. You typically should not be using the netstandard library directly as it contains stub methods / missing methods as it is just for reference only.

But... If it is working for you, then maybe we can have a look at splitting the assembly into two - one that is a "base" assembly in the lib folder for all to use and one that is in the ref folder so that it does not conflict with the platform.

We can't move it back because of #1011 in which there are two assemblies with the same name and the first (which is the netstandard) is always picked. Moving it to the ref folder means that the platform assembly is picked. It might have been working for you because you have a different assembly name for GTK?

Another options is that you can send in a PR with the code you are using for GTK and we can have a look at merging that in - then you don't need to worry about that anymore.

@mattleibow
Copy link
Contributor

@lothargrieb We just spotted that in #1042 and a fix is in #1044. I have pushed out a fix to the preview feed:

https://aka.ms/skiasharp-eap/index.json

Try version 1.68.1.1-preview.2 as that should have the fix. (there is a 1.68.2 series, but that is actually older because I decided to get .1.1 out first with this fix)

@knocte
Copy link
Author

knocte commented Dec 7, 2019

Another options is that you can send in a PR with the code you are using for GTK

Not sure what you mean with this? I just use SkiaSharp.Views.Forms in my project because one single static method I make use of: SkiaSharp.Views.Forms.Extensions.ToSKColor(). I'm sure this can be made available in a .netStandard binary which works across all platforms, or am I missing something?

@knocte
Copy link
Author

knocte commented Dec 17, 2019

Is this related to #379 ? I don't understand how this has worked before.

@mattleibow
Copy link
Contributor

This used to work because I had the nuget install the netstandard dll into platforms that were not supported. This was incorrect behavior because if you were to install the WPF nuget or the (hopefully soon) GTK nuget you would get duplicate dlls - the one from the core forms and the one from the WPF/GTK nuget. In addition, several paths would also throw exceptions

See #1012

It used to work because there was no WPF nuget to cause this issue.

If you are using just one single static method, I would really suggest just adding this extension method directly into your project instead of referenceing the NuGet with is not supported in this scenario:
https://github.com/mono/SkiaSharp/blob/master/source/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms.Shared/Extensions.cs#L63-L66

The SkiaSharp.Views.Forms NuGet is only supported in Android, iOS, macOS, UWP and Tizen platforms. There is a separate package for WPF. All other uses are not supported and will cause issues if used.

I have created an issue to actually track this implementation.

knocte added a commit to nblockchain/geewallet that referenced this issue Dec 18, 2019
To workaround this bug[1], as recommended in [2], which was preventing
us to upgrade to a newer version of SkiaSharp, which we need in order
to drop another workaround (see [3]).

[1] mono/SkiaSharp#1047
[2] mono/SkiaSharp#1047 (comment)
[3] 9398746
@mattleibow
Copy link
Contributor

Closing this for now as this is "technically" a regression as a result of fixing a bug. It was also not a supported pattern. For GTK, we will be getting a new NuGet that has much more features #1089

As a result, this particular use case will be addressed at some point with #1065, but not right now. The progress will be tracked on that issue.

@ghost ghost locked as resolved and limited conversation to collaborators Aug 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants