System.DllNotFoundException: /system/lib/libsqlite.so- Xamarin Forms System.DllNotFoundException: /system/lib/libsqlite.so- Xamarin Forms sqlite sqlite

System.DllNotFoundException: /system/lib/libsqlite.so- Xamarin Forms


The SQLite.Net-PCL nuget you used is no longer being maintained by it's author. You need to switch to other similar package sqlite-net-pcl

First remove the existing SQLite.Net-PCL nuget from all projects and install the one I mentioned above. Remove all old SQLite related references from all files.

You need to make some changes in SQLite connection related dependency service classes. Then you may adjust some other code which relates to SQLite. Resolve the references by adding appropriate using statements for the new nuget package.

I got the same error and I solved it by switching to above nuget package.

NOTE : The new nuget package does not have InsertOrReplaceAll method yet. So If you have used this method from previous nuget, then for the new nuget, you need to create an InsertOrReplaceAll extension method.

EDIT: To get the SQLiteConnection:

public SQLiteConnection GetConnection(){    return new SQLiteConnection(dpPath, false);}

There is no need to pass the platform in this new nuget. Pass false if you don't want to store DateTime as Ticks.


2 choices

  1. Change targetSdkVersion < 24, since Android 7, app can not access system private libraries.
  2. Add libsqlite.so into your own lib folder.


Little late but for someone facing the same issue, you just need to add a below line in your native code

[assembly: Xamarin.Forms.Dependency(typeof(AndroidSQLite))]

If this not work then uninstall your existing sqlite-net-pcl and install sqlite-net-pcl this library and try again