MainakChoudhury
MainakChoudhury

Reputation: 524

SQLite problems with Android 7.1 & Android 8.0 - Xamarin Forms

SQLite.Net.Standard is not working in Android 8 in Xamarin Forms. What is the alternative ?

I installed SQLIte.Net.Standard but found i was getting "Unhandled Exception: System.DllNotFoundException: /system/lib/libsqlite.so occurred" at runtime.

Further reading indicated that starting with Android 7, access to this lib was removed or restricted. Supposedly the fix was using a different Nuget package. SQLite.Net.Platform.XamarinAndroidN

Upvotes: 0

Views: 272

Answers (1)

fatderda
fatderda

Reputation: 81

I use the alternative NuGet Package sqlite-net from praeclarum with Android 8 + 9 devices and had no problems so far.

Usage:

var db = new SQLiteConnection(Path.Combine(dbPath, dbFile));
db.CreateTable<YourModel>();
var yourObject = new YourModel();
db.Insert(yourObject);

Upvotes: 1

Related Questions