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] The version of the native libSkiaSharp library (116.0) is incompatible with this version of SkiaSharp. #3117

Open
1 task done
bautistavirchar opened this issue Dec 16, 2024 · 7 comments
Labels

Comments

@bautistavirchar
Copy link

Description

The version of the native libSkiaSharp library (116.0) is incompatible with this version of SkiaSharp. Supported versions of the native libSkiaSharp library are in the range [88.1, 89.0)

Code

Stream GenerateQr(string text)
{
    using var generator = new QRCodeGenerator();

    // Generate QrCode
    var qr = generator.CreateQrCode(text, ECCLevel.L);

    // Render to canvas
    var info = new SKImageInfo(512, 512);
    using var surface = SKSurface.Create(info);
    var canvas = surface.Canvas;
    canvas.Render(qr, info.Width, info.Height);

    // Output to Stream -> File
    using var image = surface.Snapshot();
    using var data = image.Encode(SKEncodedImageFormat.Png, 100);

    var img = SKImage.FromPixels(image.PeekPixels());
    // encode the image (defaults to PNG)
    var encoded = image.Encode();
    // get a stream over the encoded data
    return encoded.AsStream();

}

Expected Behavior

WORKING VERSION 2.88.9

<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.9" />

Actual Behavior

No response

Version of SkiaSharp

3.116.0 (Current)

Last Known Good Version of SkiaSharp

2.88.9 (Previous)

IDE / Editor

Visual Studio (Windows)

Platform / Operating System

Linux

Platform / Operating System Version

Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm

Devices

No response

Relevant Screenshots

No response

Relevant Log Output

System.TypeInitializationException: The type initializer for 'SkiaSharp.SKObject' threw an exception.
       ---> System.InvalidOperationException: The version of the native libSkiaSharp library (116.0) is incompatible with this version of SkiaSharp. Supported versions of the native libSkiaSharp library are in the range [88.1, 89.0).
         at SkiaSharp.SkiaSharpVersion.CheckNativeLibraryCompatible(Version minSupported, Version current, Boolean throwIfIncompatible)
         at SkiaSharp.SkiaSharpVersion.CheckNativeLibraryCompatible(Boolean throwIfIncompatible)
         at SkiaSharp.SKObject..cctor()
         --- End of inner exception stack trace ---
         at SkiaSharp.SKObject..ctor(IntPtr handle, Boolean owns)
         at SkiaSharp.SKSurface..ctor(IntPtr h, Boolean owns)
         at SkiaSharp.SKSurface.GetObject(IntPtr handle)
         at SkiaSharp.SKSurface.Create(SKImageInfo info, Int32 rowBytes, SKSurfaceProperties props)
         at SkiaSharp.SKSurface.Create(SKImageInfo info)

Code of Conduct

  • I agree to follow this project's Code of Conduct
@mattleibow
Copy link
Contributor

mattleibow commented Dec 16, 2024

Did you update all the SkiaSharp nugets to the same version?

The error is saying you have an old native assets in your project, but a new SkiaSharp.

@bautistavirchar
Copy link
Author

@mattleibow

only this library SkiaSharp.NativeAssets.Linux.NoDependencies which the working version is 2.88.9

@elr0berto
Copy link

Got same problem. solved by downgrading to 2.88.9

@penihel
Copy link

penihel commented Dec 16, 2024

i have the same problem

@gktval
Copy link

gktval commented Jan 7, 2025

Same issue. I have SkiaSharp and SkiaSharp.View.Blazor. The nugets in the solution were all updated to 3.116.1. The fix was to clean the solution and rebuild.

@danilobreda
Copy link

danilobreda commented Jan 15, 2025

116(3.116.1) is bugged. only 88(2.88.9) and 89(does not exist) is working.
The check occurs on SkiaSharp.SkiaSharpVersion.CheckNativeLibraryCompatible

Working:
image

@vadimart92
Copy link

vadimart92 commented Jan 20, 2025

Seems like problem is only with SkiaSharp.NativeAssets.Linux.NoDependencies:

/runtimes/linux-x64/native$ readelf -d libSkiaSharp.so

Dynamic section at offset 0x8c6a60 contains 33 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libpthread.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libfontconfig.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libdl.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [ld-linux-x86-64.so.2]
 0x000000000000000e (SONAME)             Library soname: [libSkiaSharp.so.88.1.0] <----

SkiaSharp.NativeAssets.Linux works

/runtimes/linux-x64/native$ readelf -d libSkiaSharp.so

Dynamic section at offset 0x891a30 contains 33 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libpthread.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libfontconfig.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libdl.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [ld-linux-x86-64.so.2]
 0x000000000000000e (SONAME)             Library soname: [libSkiaSharp.so.118.0.0] <----

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

No branches or pull requests

7 participants