praeclarum / sqlite-net

Simple, powerful, cross-platform SQLite client and ORM for .NET
MIT License
4.08k stars 1.42k forks source link

Apple Silicon / ARM64 support? #1080

Open tipa opened 2 years ago

tipa commented 2 years ago

I want to build my Xamarin.macOS app for the Apple Silicon ARM64 architecture. This is currently a preview feature and can be enabled as described here: https://docs.microsoft.com/en-us/xamarin/mac/release-notes/7/7.13#preview-of-apple-silicon-support I was able to build & run apps targeting x64 with sqlite-net successfully in the past using sqlite-net-pcl 1.8.116 & SQLitePCLRaw.lib.e_sqlite3.osx 1.1.14. When building for ARM64, the following exception occurs:

System.DllNotFoundException has been thrown
e_sqlite3 assembly:<unknown assembly> type:<unknown type> member:(null)

Perhaps this needs to be fixed in SQLitePCL.raw and I should open an issue here @ericsink?

tipa commented 2 years ago

I played around a little more and it seems that when not using the NuGet package (neither sqlite-net-pcl nor SQLitePCLRaw.lib.e_sqlite3.osx) but simply copying the source file SQLite.cs into the app, then the app works without issues even when building for ARM64. Maybe there's something wrong with the NuGet package and the dependencies it pulls...