Appcenter: Microsoft.AppCenter WPF 2.2.1-preview error initializing storage

Created on 9 Aug 2019  路  9Comments  路  Source: microsoft/appcenter

What App Center service does this affect?
Microsoft.AppCenter WPF 2.2.1-preview

Describe the bug
Calling

AppCenter.Start("ID", typeof(Analytics), typeof(Crashes));

Results in an error.

2019-08-09 11:37:35.840 [AppCenter] ERROR: An error occurred while initializing storage
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method not found: 'System.String SQLitePCL.raw.sqlite3_column_text(SQLitePCL.sqlite3_stmt, Int32)'.
   at SQLite.SQLite3.ColumnString(sqlite3_stmt stmt, Int32 index)
   at SQLite.SQLiteCommand.ReadCol(sqlite3_stmt stmt, Int32 index, ColType type, Type clrType)
   at SQLite.SQLiteCommand.ExecuteScalar[T]()
   at SQLite.SQLiteConnection.ExecuteScalar[T](String query, Object[] args)
   at SQLite.SQLiteConnection..ctor(String databasePath, SQLiteOpenFlags openFlags, Boolean storeDateTimeAsTicks, Object key)
   at SQLite.SQLiteConnectionWithLock..ctor(SQLiteConnectionString connectionString, SQLiteOpenFlags openFlags)
   at SQLite.SQLiteAsyncConnection..ctor(String databasePath, SQLiteOpenFlags openFlags, Boolean storeDateTimeAsTicks, Object key)
   at SQLite.SQLiteAsyncConnection..ctor(String databasePath, Boolean storeDateTimeAsTicks, Object key)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.AppCenter.Storage.StorageAdapter.<InitializeStorageAsync>b__9_0()
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AppCenter.Storage.Storage.<InitializeDatabaseAsync>d__19.MoveNext()

To Reproduce
Steps to reproduce the behavior:
Call

AppCenter.Start("ID", typeof(Analytics), typeof(Crashes));

Expected behavior
AppCenter should be initialized properly.

Screenshots
NA

Desktop (please complete the following information):

  • OS: Windows 10 Pro 17763.615
analytics bug diagnostics reviewed-DRI sdk

Most helpful comment

The same here. The problem must be in SQLitePCLRaw.bundle_green, SQLitePCLRaw.core or https://github.com/praeclarum/sqlite-net. Right after I upgraded from 1.1.14 to 2.0.0 I got the same problem. Tried to check here: https://github.com/ericsink/SQLitePCL.raw/blob/master/v2.md but did not find the root cause...

All 9 comments

I had this exact same error but for a different package. I downgraded SQLitePCLRaw.Core from 2.0.0 to 1.1.14 (along with any other related package at 2.0.0) and it then worked again. You may have done a similar thing of just upgrading NuGets, with this package being one of them.

The same here. The problem must be in SQLitePCLRaw.bundle_green, SQLitePCLRaw.core or https://github.com/praeclarum/sqlite-net. Right after I upgraded from 1.1.14 to 2.0.0 I got the same problem. Tried to check here: https://github.com/ericsink/SQLitePCL.raw/blob/master/v2.md but did not find the root cause...

I had this exact same error but for a different package. I downgraded SQLitePCLRaw.Core from 2.0.0 to 1.1.14 (along with any other related package at 2.0.0) and it then worked again. You may have done a similar thing of just upgrading NuGets, with this package being one of them.

THANK YOU! I downgraded like you said and it immediately resolved the issue!

Is this issue still not fixed?
i am also getting the same error but with SQLitePCLRaw.Core 2.0.2 and Winforms

I am also not able to downgrade as there is a dependency on another library
Severity Code Description Project File Line Suppression State Error Unable to resolve dependencies. 'SQLitePCLRaw.core 1.1.14' is not compatible with 'SQLitePCLRaw.provider.dynamic_cdecl 2.0.2 constraint: SQLitePCLRaw.core (>= 2.0.2)'. 0

Still not fixes as of the last time I tried. Even if you downgrade changes are you will have an issue with another library as well. If I remember correctly it was system.web or something similar.

@hankinsoft , Thanks for the update. I am trying to reach them at the online chating support and update this thread about the status and any possible fixes.

I think this exception is related to this topic.

A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. (The database wasn't initialized.)
Problem Id:Microsoft.AppCenter.Storage.StorageException at Microsoft.AppCenter.Storage.Storage+<>c__DisplayClass30_01.b__0`

  • .NET Core 3.1 WPF
  • Microsoft.AppCenter v3.0.0

We're encountering the same issue, but the work around of reverting the SQLite package version doesn't seem to be possible on Microsoft.AppCenter v3.1.0 since it seems to require at least 2.0.

Is there any update on this or other solution beyond having to revert AppCenter to an earlier version that allows 1.1.14?

EDIT: Looks like in my scenario we were getting a very similar error, but the issue was related to our nuspec file failing to copy over the needed dll on build. Once that was fixed, we were able to use the latest version of app center and 2.0 for SQLite without any issues.

Was this page helpful?
0 / 5 - 0 ratings