ios - 无法在 Mac 上运行 iOS 版 Uno 项目 - 无法加载 `SQLitePCLRaw.core`

标签 ios sqlite xamarin uno-platform

我有一个 UWP 应用程序,我使用 Uno 将其移植到 iOS 和 Android平台。我可以在 Windows 上构建并运行 iOS 项目,但是当我尝试在 Mac 上运行它时,出现以下错误:

Error: System.TypeLoadException: Could not load type of field 'Microsoft.CodeAnalysis.SQLite.Interop.SqlConnection:_handle' (0) due to: Could not load file or assembly 'SQLitePCLRaw.core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1488e028ca7ab535' or one of its dependencies.

即使我添加对此包的引用,错误仍然存​​在,并且我无法运行该项目。完整的堆栈跟踪如下:

      at (wrapper managed-to-native) System.RuntimeType.GetPropertiesByName_native(System.RuntimeType,intptr,System.Reflection.BindingFlags,bool)
      at System.RuntimeType.GetPropertiesByName (System.String name, System.Reflection.BindingFlags bindingAttr, System.Boolean icase, System.RuntimeType reflectedType) [0x00011] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-06/external/bockbuild/builds/mono-x64/mcs/class/corlib/ReferenceSources/RuntimeType.cs:516 
      at System.RuntimeType.GetPropertyCandidates (System.String name, System.Reflection.BindingFlags bindingAttr, System.Type[] types, System.Boolean allowPrefixLookup) [0x00010] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-06/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/rttype.cs:2881 
      at System.RuntimeType.GetProperties (System.Reflection.BindingFlags bindingAttr) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-06/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/rttype.cs:3089 
      at System.Reflection.RuntimeReflectionExtensions.GetRuntimeProperties (System.Type type) [0x00006] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-06/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/reflection/RuntimeReflectionExtensions.cs:25 
      at System.Composition.TypedParts.Discovery.TypeInspector+<DiscoverPropertyExports>d__7.MoveNext () [0x00030] in <9aac21a4a3f24063b2b8b59143acddfc>:0 
      at System.Composition.TypedParts.Discovery.TypeInspector+<DiscoverExports>d__5.MoveNext () [0x000dc] in <9aac21a4a3f24063b2b8b59143acddfc>:0 
      at System.Composition.TypedParts.Discovery.TypeInspector.InspectTypeForPart (System.Reflection.TypeInfo type, System.Composition.TypedParts.Discovery.DiscoveredPart& part) [0x00061] in <9aac21a4a3f24063b2b8b59143acddfc>:0 
      at System.Composition.TypedParts.TypedPartExportDescriptorProvider..ctor (System.Collections.Generic.IEnumerable`1[T] types, System.Composition.Convention.AttributedModelProvider attributeContext) [0x00037] in <9aac21a4a3f24063b2b8b59143acddfc>:0 
      at System.Composition.Hosting.ContainerConfiguration.CreateContainer () [0x00042] in <9aac21a4a3f24063b2b8b59143acddfc>:0 
      at Microsoft.CodeAnalysis.Host.Mef.MefHostServices.Create (System.Collections.Generic.IEnumerable`1[T] assemblies) [0x0001e] in <c187f126c4894c9b948a9aabdfa3b3e0>:0 
      at Microsoft.CodeAnalysis.Host.Mef.DesktopMefHostServices.get_DefaultServices () [0x00011] in <7dc846b9b711473199b9a1835d0b3ea9>:0 
      at Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.Create (System.Collections.Generic.IDictionary`2[TKey,TValue] properties) [0x00000] in <7dc846b9b711473199b9a1835d0b3ea9>:0 
      at Uno.SourceGeneration.Host.SourceGeneratorHost.GetCompilation () [0x00125] in <a8efa0c74d824a2d829abc1245eef090>:0  (UnoSample.iOS)

我正在使用 Uno.Platform 的最新发布版本(未预发布):

  <package id="Uno.CodeGen" version="1.29.0" targetFramework="xamarinios10" />
  <package id="Uno.Core" version="1.25.0" targetFramework="xamarinios10" />
  <package id="Uno.Core.Build" version="1.25.0" targetFramework="xamarinios10" />
  <package id="Uno.Equality" version="1.29.0" targetFramework="xamarinios10" />
  <package id="Uno.Immutables" version="1.29.0" targetFramework="xamarinios10" />
  <package id="Uno.Injectable" version="1.29.0" targetFramework="xamarinios10" />
  <package id="Uno.SourceGenerationTasks" version="1.28.0" targetFramework="xamarinios10" />
  <package id="Uno.UI" version="1.42.0" targetFramework="xamarinios10" />

是否可以在 Mac 上运行使用 Uno 平台开发的 iOS 应用程序?

最佳答案

正如安德烈斯提到的,这个问题已在最新的开发中修复。如果需要,您可以通过我们的 Gitter channel 获得其他帮助:https://gitter.im/uno-platform/Lobby#

关于ios - 无法在 Mac 上运行 iOS 版 Uno 项目 - 无法加载 `SQLitePCLRaw.core`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54137737/

相关文章:

ios - 让iOS应用程序再次接收VoIP推送通知

ios - 将粘贴内容传递给 NSString

sql - 从SQLite中的特定日期检索数据

c# - 如何扩展自定义解决方案 Xamarin 的按钮

iphone - 在 iOS 中朗读文本

ios - 游戏 SKScene 转换 Swift

android - 需要算法 SQLite Android

swift - 如何从iOS SQLite数据库保存和获取数据?

xamarin - 项目链接器扩展不会安装在 Visual Studio 2013 Pro 上

c# - 如何创建 Xamarin 前台服务