0

I'm using sqlite-net-pcl for Xamarin Forms / Xamarin Andriod the previous library SQLite.Net-PCL are crashing at run time because its no longer being maintained by it's author as mentioned here .

The problem that i'm facing with sqlite-net-pcl is when creating SQLiteConnectionWithLock
specific with ISQLitePlatform parameter

new SQLiteConnectionWithLock(ISQLitePlatform, new SQLiteConnectionString(path, true));

Parameter ISQLitePlatform are interface I tried to implement the interface but I didn't figure out the correct implementation

class SQLitePlatform : ISQLitePlatform
    {
        ISQLiteApi ISQLitePlatform.SQLiteApi => throw new System.NotImplementedException();
        IStopwatchFactory ISQLitePlatform.StopwatchFactory => throw new System.NotImplementedException();
        IReflectionService ISQLitePlatform.ReflectionService => throw new System.NotImplementedException();
        IVolatileService ISQLitePlatform.VolatileService => throw new System.NotImplementedException();
    }
ASalameh
  • 783
  • 1
  • 8
  • 29
  • 3
    I don't see `ISQLitePlatform` anywhere in that pkg's github repo? – Jason Sep 30 '19 at 20:47
  • Inside SQLite.Net.Interop.ISQLitePlatform – ASalameh Sep 30 '19 at 20:48
  • 1
    I believe that what Jason was saying is that the constructor for this class `SQLiteConnectionWithLock` has only one parameter and it's the `SQLiteConnectionString` at least for the latest version **1.6.292**. `public SQLiteConnectionWithLock (SQLiteConnectionString connectionString);` what version do you have installed? @DevC – pinedax Oct 01 '19 at 05:37
  • I have version *1.6.292* too maybe I need to clear solution – ASalameh Oct 01 '19 at 06:48
  • 1
    Thanks Jason & @Pinedax I just check the packages and I notice their another package named **SQLite.Net.Async-PCL** I removed it and its works. – ASalameh Oct 01 '19 at 07:03
  • 1
    Could you please put the answer below, so we can resolve the question and its easily searchable – Saamer Oct 02 '19 at 23:09

1 Answers1

1

I checked the Packages i had in my solution and delete everything related to this package SQLite.Net-PCL

Included:
1- SQLite.Net.Async-PCL
2 -SQLite.Net.Platform.XamarinAndroidN

Only keep this package sqlite-net-pcl and its works.

ASalameh
  • 783
  • 1
  • 8
  • 29