Open AndroidEFCoreLover opened 3 years ago
Someone describes the restrictions in more detail: https://developercommunity.visualstudio.com/content/problem/841599/androidnativelibrary-so-files-will-not-deploy-to-a.html
/cc @bricelam
Note for triage: Looks like SQLite only adds the extension (dll, so, dylib, etc.) and not the 'lib' prefix like I initially thought.
A couple of thoughts...
We could expose an option to disable our call to LoadExtension. It's kind of possible today using some lower-level, pubternal APIs:
This would be helpful in this scenario, but also if you're using SpatiaLite directly as your native SQLite library (not as an extension).
We could also try loading libmod_spatialite.so if the just mod_spatialite fails (similar to how .NET probes during P/Invoke).
We could also detect if we're running on Android at runtime and only look for libmod_spatialite...
P.S. I'd love it if you could look through https://github.com/bricelam/mod_spatialite-NuGet/issues/6 and add any additional information you might have.
I switched the last to false
, and then on creation of each context, I enable loading of extensions, and load the .so
we need.
Did a round trip on point geometry on android.
Hi,
I cannot use EF Core on Android device, cause I cannot deploy 'mod_spatialite' with APK. I see Android only allows me to deploy *.so files with the name starting with "lib".
And, in: https://github.com/dotnet/efcore/blob/b8483772f298f5ada8b2b5253a9904c93c34919f/src/EFCore.Sqlite.Core/Infrastructure/SpatialiteLoader.cs#L100
we specifically require the name, without the 'lib'.
Is it possible to change the name, to allow it to be used on all platforms?