【问题标题】:AppCenter + UWP + IoT = Cannot initialize SQLite libraryAppCenter + UWP + IoT = 无法初始化 SQLite 库
【发布时间】:2018-11-11 04:01:00
【问题描述】:

我正在尝试将 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 包引用没有帮助。

AppCenter 分析是否适用于 UWP + IoT?如果有怎么办?如果没有,有什么替代方案?

【问题讨论】:

    标签: uwp windows-10-iot-core visual-studio-app-center


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

      AppCenter 分析适用于 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
      

      【讨论】:

      • 恐怕不走运。我的前台应用程序已经在使用 sqlite-net-pcl v1.4.118,我尝试将它添加到我的后台应用程序中,但输出中的错误如上所示。我确实在添加 AppCenter.Analytics 的引用时注意到了这一点: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.
      • 感谢迈克尔的回答。虽然这不是解决方案,但它鼓励我继续寻找并最终发现 sqlite-net-pcl 1.4.118 与 AppCenter.Analytics 1.6.1 不兼容。
      猜你喜欢
      • 1970-01-01
      • 2017-05-11
      • 1970-01-01
      • 2021-12-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-10
      • 1970-01-01
      相关资源
      最近更新 更多