I'm new to android and xamarin. Recently I have created one android app following xamrarin
sample TaskyPortable
. Problem is whenever following code executes it throws error.
public override void OnCreate()
{
base.OnCreate();
var sqliteFilename = "ToDoItemDB.db3";
string libraryPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
var path = Path.Combine(libraryPath, sqliteFilename);
conn = new SQLiteConnection(path);
whenever it calls new SQLiteConnection with given path, it throws
"System.TypeInitializationException: The type initializer for 'SQLite.SQLiteConnection' threw an exception."
What am I doing wrong? The code is almost similar to TaskyPortable. I have searched a lot but did not find anything.
Kindly help.
P.S. : This question is already asked here and I have checked the answer. I have added reference of SQLite.net in droid project also. But still facing this issue.