-
Notifications
You must be signed in to change notification settings - Fork 109
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
e_sqlite3 library not found in Xamarin.Mac #358
Comments
This is a known problem, although, strangely, there appears to be no issue for it. It was mentioned in the 2.0 release notes: https://github.com/ericsink/SQLitePCL.raw/blob/master/v2.md |
I'm guessing there is no workaround?, I'll try to switch to Xamarin.Modern and convert all the projects to .net standard |
Actually I'm quite sure there IS a workaround, I just don't remember how to do it. :-) The problem is conceptually rather simple -- we just need the e_sqlite3 library to end up where the Mac code can find it. Once that happens, everywhere works. I'll take a closer look again and see if I can figure something out. |
Would be much appreciated, can't imagine I'm the only one using Xamarin.Mac :) |
"can't imagine I'm the only one using Xamarin.Mac" Probably not, but it's close. :-) I've been surprised how few people have mentioned this problem. |
I had similar problem with compilation in 'Release' and used following workaround. I added it into the project file:
|
The following workaround worked for us: <ItemGroup>
<PackageReference Include="SQLitePCLRaw.lib.e_sqlite3" Version="2.0.4" PrivateAssets="None" GeneratePathProperty="true" />
<NativeReference Include="$(PkgSQLitePCLRaw_lib_e_sqlite3)/runtimes/osx-x64/native/libe_sqlite3.dylib">
<Kind>Dynamic</Kind>
<SmartLink>False</SmartLink>
</NativeReference>
</ItemGroup> |
The only way I could get this to work on my end is by copying the libe_sqlite3.dylib to my Xamarin.Mac projects Resources folder and then adding it as a native reference from there. <ItemGroup>
<BundleResource Include="Resources\libe_sqlite3.dylib" />
</ItemGroup>
<ItemGroup>
<NativeReference Include="Resources\libe_sqlite3.dylib">
<Kind>Dynamic</Kind>
<SmartLink>False</SmartLink>
</NativeReference>
</ItemGroup> |
You just need add the base sqlite3 lib:
It can fix the DllNotFoundException error. |
Been trying to get EFCore with SQLite working when using Xamarin.Mac.
At runtime it cannot load the e_sqlite3 library.
When switching to Xamarin.Modern everything works right away (but is not an option).
First thought it had to do with #343, but tried those work arounds and have had no luck.
I've got a sample demonstrating the issue with all the info I could gather here:
https://github.com/nvanlaerebeke/EFCore_XamarinMac
In the sample above I made sure to use:
And only reference Microsoft.Data.Sqlite.Core with SQLitePCLRaw.core, SQLitePCLRaw.lib.e_sqlite3 and SQLitePCLRaw.provider.e_sqlite3 as mentioned in #343
Don't think I missed any:
https://github.com/nvanlaerebeke/EFCore_XamarinMac/blob/master/XamarinMac_EFCore/packages.config
Any idea how to get it to work?
Think this is an issue with Xamarin.Mac specifically as it works fine using Xamarin.Modern
The text was updated successfully, but these errors were encountered: