Appcenter-sdk-dotnet: Could not load file or assembly 'SQLitePCLRaw.batteries_v2'

Created on 5 Mar 2020  路  10Comments  路  Source: microsoft/appcenter-sdk-dotnet

This library requires 50 dependencies and yet it cannot run because you are loading an incorrect version of the assembly. FIX ASAP.

[AppCenter] ERROR: An error occurred while initializing storage
System.TypeInitializationException: The type initializer for 'SQLite.SQLiteConnection' threw an exception. ---> System.IO.FileLoadException: Could not load file or assembly 'SQLitePCLRaw.batteries_v2, Version=2.0.2.669, Culture=neutral, PublicKeyToken=8226ea5df37bcae9' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) ---> System.IO.FileLoadException: Could not load file or assembly 'SQLitePCLRaw.batteries_v2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8226ea5df37bcae9' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
   --- End of inner exception stack trace ---
   at SQLite.SQLiteConnection..cctor()
   --- End of inner exception stack trace ---
   at SQLite.SQLiteConnection..ctor(String databasePath, SQLiteOpenFlags openFlags, Boolean storeDateTimeAsTicks)
   at SQLite.SQLiteConnectionWithLock..ctor(SQLiteConnectionString connectionString, SQLiteOpenFlags openFlags)
   at SQLite.SQLiteConnectionPool.Entry..ctor(SQLiteConnectionString connectionString, SQLiteOpenFlags openFlags)
   at SQLite.SQLiteConnectionPool.GetConnection(SQLiteConnectionString connectionString, SQLiteOpenFlags openFlags)
   at SQLite.SQLiteAsyncConnection.<CreateTablesAsync>c__AnonStorey0.<>m__0()
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AppCenter.Storage.StorageAdapter.<CreateTableAsync>d__4`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AppCenter.Storage.Storage.<InitializeDatabaseAsync>d__19.MoveNext()
support

All 10 comments

Hi @jozefizso, this issue could be caused by a conflict with another SQLite dependency. Would you be able to provide the list of your application's dependencies so we can understand what鈥檚 causing your issue? Thanks.

Our app is using what ever your SDK has defined in the Nuget.

https://github.com/jozefizso/AppCenterIssue1348

image

Hi @jozefizso ,

Extra dependencies issue was because of known issue in sqlite-net, it was resolved in v1.4.118. Also, we have removed sqlite-net dependency at all in 3.0.0

I've fixed the dependencies in your project - https://github.com/jozefizso/AppCenterIssue1348/pull/1

@jozefizso I'm closing this ticket, feel free to re-open if you have any more issues.

what was the soltuion here? i get same error using on 3.1 version

The type initializer for 'Microsoft.AppCenter.Storage.StorageAdapter' threw an exception.
   at Microsoft.AppCenter.AppCenter.InstanceConfigure(String appSecretOrSecrets)
   at Microsoft.AppCenter.AppCenter.PlatformStart(String appSecret, Type[] services)
   at Microsoft.AppCenter.AppCenter.Start(String appSecret, Type[] services)

   at Microsoft.AppCenter.AppCenter.InstanceConfigure(String appSecretOrSecrets)
   at Microsoft.AppCenter.AppCenter.PlatformStart(String appSecret, Type[] services)
   at Microsoft.AppCenter.AppCenter.Start(String appSecret, Type[] services)

I have these 2 libraries installed. are they conflicting?

image

Hi @EmilAlipiev ,

As mentioned in changelog for 3.0.0:

[Dependency changes] Update SQLitePCLRaw.bundle_green dependency to version 2.0.2 and remove dependency from sqlite-net-pcl.

App Center SDK v3.0 and above is not compatible with SQLitePCLRaw.* v1. NuGet should show a warning that these dependencies are incompatible in your project.

So you mean i should simply update to 2.0.2? if it is the case, i updated but still i am getting this crash for some reason

@EmilAlipiev yes, updating 2.0.2 should work. Please open new issue and fill the template. Currently, I don't have enough info to help.

i installed version 3.0.3 and sqlite 2.0.3... but same error issued!

@aminmashayekhi please also open a new issue and attach as many details as possible - at least verbose logs. Thanks!

Was this page helpful?
0 / 5 - 0 ratings