-
Notifications
You must be signed in to change notification settings - Fork 40
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
The type initializer for 'SkiaSharp.SKImageInfo' threw an exception. #26
Comments
thank you for the report. samples/ManualGenerate and samples/SimpleGenerate can build with both of following package reference. <ItemGroup>
<PackageReference Include="SkiaSharp.QrCode" Version="0.4.0" />
</ItemGroup> <ItemGroup>
<PackageReference Include="SkiaSharp" Version="2.80.2" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.80.2" />
<PackageReference Include="SkiaSharp.QrCode" Version="0.4.0" />
</ItemGroup>
|
Thanks for the reply, these are my package references:
|
Ok, I've confirm it reproduce on docker. Let me check. version: "3"
services:
netcoreapp3.1:
image: mcr.microsoft.com/dotnet/core/sdk:3.1
command: dotnet run --csproj BuildTest.csproj -f netcoreapp3.1
working_dir: /src
volumes:
- ./3.1/:/src
netcoreapp5.0:
image: mcr.microsoft.com/dotnet/sdk:5.0
command: dotnet run --csproj BuildTest.csproj -f net5.0
working_dir: /src
volumes:
- ./5.0:/src
|
temporary workaround, add libfontconfig1 package. apt update
apt install -y libfontconfig1 This is obvious.... I'm digging into more detail. |
related. |
related. Hm, https://www.nuget.org/packages/SkiaSharp.NativeAssets.Linux.NoDependencies is one choice. |
Ok, let's change to SkaiSharp.NativeAssets.Linux.NoDependencies 2.80.2 |
@AlexGipp Can you try with following package? update: I've released 0.4.1. Please use 0.4.1 and <ItemGroup>
<PackageReference Include="SkiaSharp.QrCode" Version="0.4.1" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.80.2" />
</ItemGroup> In your case, <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Discord.Net" Version="2.2.0" />
<PackageReference Include="Discord.Net.Core" Version="2.2.0" />
<PackageReference Include="SkiaSharp" Version="2.80.2" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.80.2" />
<PackageReference Include="SkiaSharp.QrCode" Version="0.4.1" />
</ItemGroup>
</Project> |
I still get the same error using the following package references: <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Discord.Net" Version="2.2.0" />
<PackageReference Include="Discord.Net.Core" Version="2.2.0" />
<PackageReference Include="SkiaSharp" Version="2.80.2" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.80.2" />
<PackageReference Include="SkiaSharp.QrCode" Version="0.4.1" />
</ItemGroup>
</Project> |
I can't reproduce issue, can you provide minimum reproduceable sample? |
I gave you access to the repo (branch: feature/QRCode_generation_rework). i use the following command to publish my solution:
As soon as it hits this part: info = new SKImageInfo(660, 660); it crashes with the same error. |
thank you, I will check it later. |
Awesome thanks, i will also add a short video later on that shows exactly what i mean. |
@guitarrapc did you firgure anything out / did you manage to reproduce the issue? |
@AlexGipp Sorry I was down for these days, Let me check tonight. |
@AlexGipp Hi, I've tried your repo with this lib's branch. # on bash on Ubuntu 20.04 LTS
$ dotnet publish -c Release -r linux-x64 --self-contained false
$ cd ./bin/Release/netcoreapp3.1/linux-x64
$ dotnet YOUR_APP_NAME.dll I've pushed test code branch to your origin for your reference. Let's cralify detail.
|
Thanks for getting back to me @guitarrapc, my linux environment is: Debian 10 x64 (buster) |
A Dockerfile I've pushed to your repo was |
@guitarrapc So how did you actually solve the issue? |
@AlexGipp I did nothing to docker image, it means default 3.1-buster-slim image doens't trouble any. image seems setup with https://github.com/dotnet/dotnet-docker/blob/801573a24f0c45fabb0db24ff8d3425c1957e068/src/runtime/3.1/buster-slim/amd64/Dockerfile and https://github.com/dotnet/dotnet-docker/blob/c0e8be8a44b47b1dcc2a5b4b2ebd92022087ac0b/src/runtime-deps/3.1/buster-slim/amd64/Dockerfile based on buster's scratch image https://github.com/debuerreotype/docker-debian-artifacts/blob/794e462d2825fb1ebb3d54ff5c93dd401cf28b9a/buster/slim/Dockerfile. runtime:3.1-buster-slim has installed packages for dotnet runtime, but it should be same to your env, right?.
Situation indicate trouble is something due to your environment specific and I need reproduceable step to determine root cause. |
no update? let's close issue. |
If i build this for linux, i get the error:
The type initializer for 'SkiaSharp.SKImageInfo' threw an exception.
Exception:
The text was updated successfully, but these errors were encountered: