- Home /
DllNotFoundException: sqlite3
Hello! I'm trying to solve the problem for a long time, maybe there is something I miss. I work with SQLite. Everything works fine at PC (Windows). While trying to open connection to the database at Android, I get the following exception: System.DllNotFoundException: sqlite3 at (wrapper managed-to-native) Mono.Data.SQLite.UnsafeNativeMethods:sqlite3_open_v2 (byte[],intprt&,int,intptr) at Mono.Data.SQLite.SQLite3.Open (System.String strFilename, SQLiteOpenFlagsEnum flags, Int32 maxPoolSize, Boolean usePool) [0x00000] in :0 at Mono.Data.SQLite.SQLiteConnection.Open () [0x00000] in :0 at IVI_GameManager.connectToDB () [0x00000] in :0
The files in the folder "Plugins" of the project are:
Mono.Data.Sqlite.dll;
sqlite3.dll;
System.Data.dll;
The code openning the connection is:
IDbConnection dbcon = new SqliteConnection(connectionString);
dbcon.Open();
Unity Version: 4.6.1f1
Please, tell me the ways to solve the issue.
Um, if it works on a pc then the sqlite3dll is an intel one. It won't then work on an Android device with presumably an arm core. (Unless these are c# assemblies.)
What about for a $$anonymous$$indle Fire build? What DLLs are needed?
Answer by Polkovskoi · Jan 09, 2015 at 01:55 PM
The probllem is solved this way: besides Mono.Data.Sqlite.dll, sqlite3.dll and System.Data.dll it is necessary to use library libsqlite3.so. Pay attention that for ARM and x86 you need different libraries. To use the needed library version, depending on type of device (ARM or x86), it is necessary to create the folder "Android" in the folder "Plugins", folder "libs" in "Android", "armeabi-v7a" and "x86" in folder "libs", in which you shoud place the corresponding versions the libraries. Like this:
You can download the version of the library for the x86 here and for ARM here.
I tried this solution but still get the same error. Actually my problem might be slightly different from yours in that it works fine in the editor but not so on a standalone or android compile.
$$anonymous$$aybe a bit to late, but a solution for Windows I didn´t found at the Internet was simply changing the architecture in the Build Settings from x86 to x86_64!
Answer by sudhindra21 · Mar 30, 2018 at 11:51 AM
Please help in solving this problem... Thanks in advance
Hi. I had that problem. You need have all dll and files of Plugins.rar of "https://github.com/walidabazo/SQLiteUnity3d_Android" on your Assets file on your proyect.
Answer by cdr9042 · Jan 29, 2021 at 03:34 AM
If you still get the error after adding SQL's dll, try installing .NET Framework 3.5 https://www.microsoft.com/en-us/download/details.aspx?id=21
Your answer
Follow this Question
Related Questions
Sqlite db error build iphone4 0 Answers
Clearing cached sqlite 1 Answer
Database (SQLite) Setup for Unity 0 Answers
Spatialite under Unity 0 Answers
SQLite and Lists in C# 1 Answer