Closed ecsplendid closed 2 years ago
(let's hold off on the paid consulting idea for the moment)
I'm pretty sure this library doesn't work with Unity. I would like to figure things out and make that happen, but I don't have any experience with Unity.
Can anyone here summarize the issues? At first glance, this looks like a target framework problem.
IIRC, NuGetForUnity doesn't handle the runtimes
directory of packages. You need to manually add it to your project (next to the lib
directory), then configure the Platform settings for each native e_sqlite3 library. Here's a screenshot from a demo I did a few years ago showing how to do this:
Thanks so much for the help, that was very useful! @bricelam
I tried this, and I now get a message saying that the .dylib is an x64, not an apple silicone. I guess this PCL library doesn't bundle the assembly for M1 anyway? But this is very useful thanks so much
SQLitePCLRaw does include a dylib for M1.
In the nuget package SQLitePCLRaw.lib.e_sqlite3
, it should be at the path runtimes/osx-arm64/native/libe_sqlite3.dylib
.
Ah - thanks for the nudge. This might be another weird Unity NuGet behaviour. It guesses which platform you are on, and deletes the other assemblies.
I tried using the nuget command line to download your package-
Then copied the correct assembly in to assets, and checked the boxes as indicated by @bricelam
osx-x64
│ └── native
│ └── libe_sqlite3.dylib
And... it works!
Thank you both so much
Hey folks
I get this error. Unity is a pain. I want to use the sqlite library https://github.com/praeclarum/sqlite-net -- in our code I noticed that it was using the code from this library from 12 years ago, although now after all this pain I am starting to see why. We want to update to the latest version of the library because we're getting all sorts of threading crashes. Before it was presumably loading in the sqllite lib, installed on my main system. So I updated to the latest version of sqlite-net, and that was what led me to need to install this library.
I have used the "NuGet plugin" for Unity, installed a combination of packages until I could get it building --
Which is to say;
When I look in the nuget folders which were downloaded, I don't see a .dylib which presumably my mac needs. The Unity nuget manager only downloads the .net standard 2 folder, if I download with another package manager, I can see such a file on the osx bundle
If I install with the unity package manager, the dylib is excluded
If I copy the runtimes and build folders back in, it doesn't stop the dll not found error.
Perhaps I need to copy the
libe_sqlite3.dylib
file somewhere, but I have no idea where...@ericsink we would pay you for an hour of consultancy to help us troubleshoot, interested?
Best Tim