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

Native library not found in resource path #16

Open
russellbanks opened this issue Jul 3, 2023 · 2 comments
Open

Native library not found in resource path #16

russellbanks opened this issue Jul 3, 2023 · 2 comments

Comments

@russellbanks
Copy link
Contributor

russellbanks commented Jul 3, 2023

Using 1.0.3:

java.lang.UnsatisfiedLinkError: Unable to load library 'path-to\libnfd':
The specified module could not be found.

[...]

java.io.IOException: Native library (win32-x86-64/path-to-temp-folder\libnfd.dll) not found in resource path

The native file dialog dll appears to be in the computer's temporary folder, rather than in the resource path. This makes it fallback to JVM file picker.

@AChep
Copy link
Collaborator

AChep commented Jul 3, 2023

That's weird. On start the library copies platform specific binaries to a temporarily directory and then loads it.

Can you check that the

instance = Native.load(libraryFile.canonicalPath, NfdLibraryNative::class.java) as NfdLibraryNative

libraryFile.canonicalPath points to an existing .dll on your system?

@russellbanks
Copy link
Contributor Author

Is there a way we could bundle it with the app itself (Gradle plugin or something else)? We're using IO every time the app starts I believe.

This is my branch to reproduce: russellbanks/HashHash/tree/native-file-dialog

libraryFile.canonicalPath points to an existing .dll on your system?

I'm not sure how I would test that without cloning this library.

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

No branches or pull requests

2 participants