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 · 4 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

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

4 participants