Champy
Champy

Reputation: 43

SQLitePCLRaw on macOS Mojave : Unable to load shared library 'e_sqlite3' or one of its dependencies

I have a C# cross platform (Windows + macOS) app that uses EF Core with SQLite to access a local database that is shipped with the app.

It works perfectly on all Windows devices and on the recent versions of macOS. However one of my user has a problem on his macOS Mojave (10.14). The first time the app try to access the database (no matter the operation: read, write, migration, etc), the following exception is raised:

System.DllNotFoundException: Unable to load shared library 'e_sqlite3' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(libe_sqlite3, 1): image not found at SQLitePCL.SQLite3Provider_e_sqlite3.NativeMethods.sqlite3_libversion_number() at SQLitePCL.SQLite3Provider_e_sqlite3.SQLitePCL.ISQLite3Provider.sqlite3_libversion_number() at SQLitePCL.raw.SetProvider(ISQLite3Provider imp) at SQLitePCL.Batteries_V2.Init()

Here are my nuget packages for info: enter image description here

What I tried:

I'm having a hard time figuring out what's causing this and would appreciate any help.

Thanks

Upvotes: 1

Views: 395

Answers (1)

SIELA1915
SIELA1915

Reputation: 26

I had the same problem, and it appears to be related to the Microsoft.EntityFrameworkCore.SQLite NuGet package. The latest version that works on macOS Mojave (10.14) is 7.0.2, every version after that the dynamic library doesn't load. Not sure if compatibility could be restored in later versions, but since Mojave is quite outdated I doubt that compatibility will be restored in newer versions. So if it really needs to work on Mojave you probably have to stick with the 7.0.2 version of this package.

Upvotes: 1

Related Questions