Uno.Samples icon indicating copy to clipboard operation
Uno.Samples copied to clipboard

Missing sample and docs for SkiaSharp.Uno.Wasm

Open artemiusgreat opened this issue 4 years ago • 3 comments

Hi, there are 2 separate repositories that mention using SkiaSharp in a WebAssembly app but none of them seems to work because none of them has any pages to display, which expectedly gives appropriate exception saying that "there is nothing to display because the default page was not defined".

Uno.SkiaSharp Uno.Samples

Could somebody point me to working sample of Uno + SkiaSharp for web apps please? The main goal is to migrate this charting tool to Uno or some sort of web assembly that could be displayed in the browser.

artemiusgreat avatar Aug 12 '21 20:08 artemiusgreat

The Uno.SkiaSharp repository is now considered legacy, as the code has been migrated to the official SkiaSharp repository. We'll update the repo to mark it as such and make it clear.

If you're getting errors with the sample in Uno.Samples, it's likely because you're getting a compilation error. Make sure to rebuild the application completely before trying again.

You can troubleshoot build errors with binlogs.

jeromelaban avatar Aug 13 '21 11:08 jeromelaban

Thank you for the reply. Yes, you're right, in the previous scenario there were some of build issues described in the link from your comment.

  1. Warning - long path names are not supported - resolved in the registry
  2. Missing Linux installation - resolved by changing WSL 2 to 1 and installed exactly 20.0.4 version

Even after this some projects weren't building, e.g. UWP was always skipped complaining about missing features. Then, I found this article Installed uno-check which was very helpful and pointed to missing installation of Android and Windows 10 SDK. After this I installed Uno template as VS extension, created a new UNO project, but for some reason VS suggested that I also need to install Azure related features, so just in case I installed everything that was available in VS Installer and got another issue.

MsBuildSdkResolver can't pick the right version because there is a conflict between 
microsoft.net.sdk.mono.toolchain and microsoft.net.sdk.emscripten

After this, I removed everything related to .NET frameworks, C++ redistributable, Visual Studio, etc and installed clean pure version of VS 2022 with only 3 features - ASP, UWP, and Desktop development. Installed UNO templates one more time as VS extension, created a new UNO project and got another error.

Error CS0234 The type or namespace name 'AspNetCore' does not exist in the namespace 'Microsoft' 
(are you missing an assembly reference?) DemoUno.Wasm	
D:\DemoUno\DemoUno.Wasm\obj\Debug\net6.0\DemoUno.Wasm.ImplicitNamespaceImports.cs

I appreciate any ideas regarding possible fix...

image

artemiusgreat avatar Aug 13 '21 18:08 artemiusgreat

Thanks :) You're on the bleeding edge, and hitting an issue with .NET 6 Preview 7 which breaks all existing projects (it'll be fixed in .NET 6 RC1).

For that last part, add the following to your project:

<PropertyGroup>
   <DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
</PropertyGroup>

jeromelaban avatar Aug 13 '21 18:08 jeromelaban

Closing this as the current skia sample should be working now

nickrandolph avatar Sep 14 '23 09:09 nickrandolph