-
Notifications
You must be signed in to change notification settings - Fork 106
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
trying to load libe_sqlite3.so from /usr/lib (reopen) #341
Comments
When trying to load from /usr/lib, you probably want the name of the library to be I use the |
I tried both, as i have both libe_sqlite3.so and libsqlite3.so in the /usr/lib |
Just to confirm, you're on .NET Core 3.x, right? |
yes |
Attached is a little sample app that demonstrates what you are trying to do. In this example, I dropped libe_sqlite3.so in my home directory and used that path to access it, but you can use whatever path you want. |
Thank you, |
Nah, ugly was just a convenient (for me) way to write the little test at the bottom to verify that it works. |
i changed the batteries_v2.cs file like this: please note that I had to change the code to this :
due to exception in the build:
after i changed the code and compiled, and replace only SQLitePCLRaw.core.dll and SQLitePCLRaw.provider.dynamic_cdecl.dll files in my folder, run my app, and i get this error:
|
Why do you have a batteries_v2.cs file? The sample I attached does not. |
where else can I integrate the code inside the SQLitePCL.raw code? and the only place i found which is calling to SQLitePCL.raw.SetProvider is in batteries file |
The batteries/bundles are convenience packages that call SetProvider for you. In your case, you want to call SetProvider yourself, as shown in the sample I uploaded. I'm pretty sure you should be using this version of Microsoft.Data.Sqlite if you are not already: https://www.nuget.org/packages/Microsoft.Data.Sqlite.Core/ The difference between Microsoft.Data.Sqlite.Core and regular Microsoft.Data.Sqlite is that the former doesn't take a dependency on a bundle, so that you can initialize SQLitePCLRaw for yourself. |
@ericsink, I need your help. How can I use this in a class library that uses "netstandard2.0;net461;monoandroid90;monoandroid10.0;xamarin.ios10" |
@angelrishi That question is too vague. You need to open a new issue and post complete information about what trouble you are having. |
@ericsink Apologies for not being clear. We are using "Azure.Mobile.Client" for offline sync in Xamarin.Forms. SQLitePCLRawHelpers.GetSqliteConnection(dbPath) This INIT call infact would call: For Android: For iOS: Now, as we're using a custom build of SQLITE as .so file in Android, I cannot use Batteries_V2.Init();. Then I removed Batteries_V2.Init(); and replaced it with: SQLite3Provider_dynamic_cdecl.Setup("sqlite3", new NativeLibraryAdapter("libsqliteX.so")); For NativeLibraryAdapter, I am using SQLITEPCL.NATIVELIBRARY as this is not .net core: class NativeLibraryAdapter : IGetFunctionPointer
The things are not working. The file is not being read and the following line: breaks the Mobile APP. Could you please give me a direction that how I can use "libsqliteX.so" in Xamarin Android using SQLitePCLRawHelpers? Your guidance will help me a lot. Please guide. Thanks. Angel |
I can't find libe_sqlite.so file anywhere and this is the only forum I came into. Where can I find this library for both armv7 and arm64 architectures? |
@bartutiryakioglu In the nuget package |
Closing old/stale issue. If there is anything here that still needs attention, please open a new issue. |
@ericsink
@bricelam
in continuation to dotnet/efcore#20462
I am opening the issue again because i am stuck, and have no other channel to ask for some guidance.
i need the native library libe_sqlite3.so to run from /usr/lib and not from the relative path like ../runtimes/linux-x64/native/libe_sqlite3.so
following this hint from eric:
#325
I have edited the /src/common/batteries_v2.cs file,
added the code:
to class:
then changed the
method to use
and, of course nothing is working...
So, is there a different way for me to load the native library from /usr/lib?
even if it is hardcoded path and file name, its fine, I just cant find the place for this to work.
Thank you in advance.
The text was updated successfully, but these errors were encountered: