0

Using LiteDB with Xamarim forms, creating a database using this:

   var documentsPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
   var dirPath = Path.Combine(documentsPath, "MyDB.db");
  • Debugging in an Android emulator, works fine.
  • Debugging in a real device, works fine.
  • Installing in a real device using .apk, does not work.

Seems the database file is not there when You tried to open it or query it .

What do I missing here?

Taslim Oseni
  • 6,086
  • 10
  • 44
  • 69
  • What error or related log is produced when running this on a real device? – Bink Mar 10 '20 at 20:39
  • "message": "The type initializer for 'LiteDB.BsonExpression' threw an exception.", "stackTrace": " at LiteDB.LiteCollection`1[T].Query () <0x7e98d4e9b0 + 0x00048> in :0 \n at LiteDB.LiteCollection`1[T].FindAll () <0x7e98d4ea40 + 0x00013> in :0 \n at xxxxxx.Repository.Users.Get () [0x00006] in <3bd65f27a3f240d0b7ad01ec7b9f1ad4>:0 ", "innerExceptions": [ { "type": "System.ArgumentNullException", "message": "Value cannot be null.\nParameter name: method", – Luiz Vianna Mar 10 '20 at 20:47

1 Answers1

0

I had to whitelist LiteDB in the linker as some internals were getting removed.

joe
  • 1,125
  • 9
  • 18