[Unity] Problem with SQLite on Android

Hello, I have been trying to get SQLite to work on my Android device for days now. First of all, I want to point out, that everything works fine on the computer. I can read and write to the created SQLite database with no errors.

The problem starts when I export the project to .apk and install it on my Android device. When I’m trying to do anything involving the databse, nothing is happening.

The logcat message:
48140-error.png

What have I done to this point:

  1. Downloaded and put sqlite3.dll to Assets/Plugins folder
  2. Copied System.Data.dll and Mono.Data.Sqlite.dll from Unity\Editor\Data\Mono\lib\mono\2.0 folder to Assets/Plugins folder in my project
  3. Created database using ‘SQLite Administrator tool’ and put it in the Assets folder
  4. Created Assets/Plugins/Android folder and put libsqlite3.so in it

As I said before, this works perfectly fine on the computer (in the Unity Editor), but not on the Android device.

I was looking for the solution everywhere, but in most cases putting libsqlite3.so to the Assets/Plugins/Android solved the problem. Any help will be appreciated.

Try putting the database in StreamingAssets folder or use file I/O and save it to Application.PersistantDataPath

Seems like it’s also not able to find the actual sqlite dll though. Could be that the dll is not supported on Android.

I’ve used this library with success for compiling on Android