AppCenter + UWP + IoT = 无法初始化 SQLite 库



我正在尝试将AppCenter Analytics集成到我的Windows IoT Core UWP应用程序中。 启动时,我不断收到以下错误:

[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)

我在前台和后台应用程序上都收到此错误。 添加 SQLite.UWP.2015 SDK 引用无济于事。 添加 SQLite.Net-PCL 包引用无济于事。

应用中心分析是否适用于 UWP + IoT? 如果是这样,怎么办? 如果不是,还有什么替代方案?

Microsoft.AppCenter.Analytics v1.6.1 和 sqlite-net-pcl v1.4.118 之间存在冲突。 要解决此问题,请将 sqlite-net-pcl 降级到 1.3.3。

AppCenter Analytics 可与 Windows IoT Core 上的 UWP 配合使用。从您的错误日志中,我认为这是由于错过了相关的sqlite库或版本与依赖于SQLite-net 1.1的其他库冲突。AppCenter 分析依赖于 sqlite-net-pcl 1.3.1 或更高版本。您可以尝试通过以下命令在程序包管理器控制台中安装此程序包:

Install-Package sqlite-net-pcl -Version 1.4.118

最新更新