0

I'm trying to integrate AppCenter Analytics into my Windows IoT Core UWP app. On startup I keep getting the following error:

[AppCenter] ERROR: Failed to configure App Center. Microsoft.AppCenter.Storage.StorageException: Cannot initialize SQLite library. ---> System.IO.FileLoadException: Could not load file or assembly 'SQLite-net, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) at Microsoft.AppCenter.Storage.StorageAdapter..ctor(String databasePath) at Microsoft.AppCenter.Storage.Storage.DefaultAdapter() --- End of inner exception stack trace --- at Microsoft.AppCenter.Storage.Storage.DefaultAdapter() at Microsoft.AppCenter.AppCenter.InstanceConfigure(String appSecretOrSecrets) at Microsoft.AppCenter.AppCenter.PlatformStart(String appSecret, Type[] services)

I get this error on both Foreground and Background apps. Adding a SQLite.UWP.2015 SDK reference doesn't help. Adding SQLite.Net-PCL package reference doesn't help.

Does AppCenter analytics work with UWP + IoT? If so how? If not what are the alternatives?

Lee Richardson
  • 8,331
  • 6
  • 42
  • 65

2 Answers2

1

There is a conflict between Microsoft.AppCenter.Analytics v1.6.1 and sqlite-net-pcl v1.4.118. To resolve the problem downgrade sqlite-net-pcl to 1.3.3.

Lee Richardson
  • 8,331
  • 6
  • 42
  • 65
0

AppCenter analytics works with UWP on Windows IoT Core. From your error log, I think it is due to miss the relative sqlite library or the version is conflict with other library which depends on SQLite-net 1.1. AppCenter analytics depends on sqlite-net-pcl 1.3.1 or later.You can try to install this package in Package Manager Console via command:

Install-Package sqlite-net-pcl -Version 1.4.118
Michael Xu
  • 4,382
  • 1
  • 8
  • 16
  • No luck with that I'm afraid. My foreground app was already using sqlite-net-pcl v1.4.118 and I tried adding it to my background app but same error in output as shown above. I did notice this on add reference of AppCenter.Analytics btw: `NU1603: runtime.native.System.IO.Compression 4.3.0 depends on runtime.win10-arm64.runtime.native.System.IO.Compression (>= 4.3.0) but runtime.win10-arm64.runtime.native.System.IO.Compression 4.3.0 was not found. An approximate best match of runtime.win10-arm64.runtime.native.System.IO.Compression 4.3.1 was resolved.` – Lee Richardson Jun 02 '18 at 20:16
  • Thanks for this answer Michael. While it wasn't the solution, it encouraged me to keep looking and ultimately to the discovery that sqlite-net-pcl 1.4.118 is incompatible with AppCenter.Analytics 1.6.1. – Lee Richardson Jun 03 '18 at 16:00