radimitrov / CSharpShellApp

87 stars 18 forks source link

The type initializer for 'Microsoft.Data.Sqlite.SqliteConnection' threw an exception. (Microsoft.Data.Sqlite) #389

Open huggiewuggies opened 3 months ago

huggiewuggies commented 3 months ago

i tried to create a simple application that uses sqlite as its database. Everything works fine when debugging but after exporting the apk, it printed an error.

"System.TypeInitializationException: The type initializer for 'Microsoft.Data.Sqlite.SqliteConnection' threw an exception."

This error pointed to a line of code but that code was just a string.

var connStr = @"Data Source=database.db";

if someone had encountered and solved this problem, mind sharing the solution and the cause of the error? Thanks!

radimitrov commented 3 months ago

It was caused by an update to how the native libraries are included. Should be fixed in next IDE update