Skip to content

[BUG] Unity Editor can’t find dependency DLLs in subfolders anymore (DLLNotFoundException) #3016

Closed

Description

@SashelI

Description

Hi,

I came into some frustrating issue today in the editor : I have a project in which I have manually imported libraries. All of the required dependencies are also in the project, in a subfolder (see screenshots below).

This project was working fine and finding everything it needed. Today I downloaded the new version of the libraries (from skiasharp 2.88.7 to skiasharp 2.88.8), replaced DLLs without changing any of the folder structure, and suddendly, with two different libraries (libSkiaSharp and pdfium from SkiaSharp and PDFToImage), when I hit play i have a “DLLNotFoundException” on the dependencies, but only if they are in a subfolder…

I have many dlls and .so because this is a cross-platform project (android ARM64 + android x64 + UWP ARM64 + Winx64), so putting every single dependency dll in the same folder is a no-go.

Anyone knows why this happens ?
Thanks.

Here are the screenshots :

Working old project structure, this exact same structure on the updated dlls doesn’t work, and I have to put libskiasharp.dll in the root Skia folder :

image
image

(And same goes for pdfium.dll)

Code

https://github.com/SashelI/skiadll-tests-unity

Expected Behavior

No response

Actual Behavior

DllNotFoundException: libSkiaSharp assembly:<unknown assembly> type:<unknown type> member:(null) SkiaSharp.SKImageInfo..cctor () (at <ba5db125678d4cb8bfb461a6f3fca1c2>:0) Rethrow as TypeInitializationException: The type initializer for 'SkiaSharp.SKImageInfo' threw an exception.

Version of SkiaSharp

Other (Please indicate in the description)

Last Known Good Version of SkiaSharp

Other (Please indicate in the description)

IDE / Editor

Other (Please indicate in the description)

Platform / Operating System

Windows

Platform / Operating System Version

Windows 10 x64

Devices

No response

Relevant Screenshots

image
image

Relevant Log Output

`DllNotFoundException: libSkiaSharp assembly:<unknown assembly> type:<unknown type> member:(null)
SkiaSharp.SKImageInfo..cctor () (at <ba5db125678d4cb8bfb461a6f3fca1c2>:0)
Rethrow as TypeInitializationException: The type initializer for 'SkiaSharp.SKImageInfo' threw an exception.`

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. SashelI commented on Sep 24, 2024

    @SashelI
    Author

    Update : the issue is even weirder : it actually can’t find the dll anywhere on each project startup until I move the dll file to a different folder ?? But no matter the folder :

    I have my dll in a Skia/win-64/native subfolder.
    I open the Unity project, click play : DLLNotFound
    I ctrl+x the dll, put it in Skia/ folder.
    hit play, it works
    I close the editor
    I open the Unity project again
    I hit play : DLLNotFound
    I ctrl+x the dll, put it in Skia/win-64/native subfolder
    Hit play, it works
    What ?

    Here is a repo with the issue on it, if anyone wants to give it a try : https://github.com/SashelI/skiadll-tests-unity

  2. locked and limited conversation to collaborators on Sep 30, 2024
  3. converted this issue into a discussion #3023 on Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions