1

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

错误:System.TypeLoadException:无法加载字段“Microsoft.CodeAnalysis.SQLite.Interop.SqlConnection:_handle”(0)的类型,原因是:无法加载文件或程序集“SQLitePCLRaw.core,版本=1.0.0.0,文化=中性,PublicKeyToken=1488e028ca7ab535' 或其依赖项之一。

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

      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 应用程序?

4

2 回答 2

3

正如 Andres 所提到的,这已在最新的开发中得到修复。如果需要,您可以在我们的 Gitter 频道上获得更多帮助:https ://gitter.im/uno-platform/Lobby#

于 2019-01-11T01:16:58.097 回答
0

我试图将 Uno.UI 包更新到最新的预发行版 - 它没有帮助。我不仅要更新 Uno.UI 包,还要手动更新所有未使用 Uno.UI 拉取的相关包:

  <package id="Uno.CodeGen" version="1.30.0-dev.107" targetFramework="xamarinios10" />
  <package id="Uno.Core" version="1.26.0-dev.61" targetFramework="xamarinios10" />
  <package id="Uno.Core.Build" version="1.26.0-dev.61" targetFramework="xamarinios10" />
  <package id="Uno.Equality" version="1.30.0-dev.107" targetFramework="xamarinios10" />
  <package id="Uno.Immutables" version="1.30.0-dev.107" targetFramework="xamarinios10" />
  <package id="Uno.Injectable" version="1.30.0-dev.107" targetFramework="xamarinios10" />
  <package id="Uno.Roslyn" version="1.2.0-dev.18" targetFramework="xamarinios10" />
  <package id="Uno.SourceGenerationTasks" version="1.29.0-dev.226" targetFramework="xamarinios10" />
  <package id="Uno.UI" version="1.43.0-dev.614" targetFramework="xamarinios10" />

这个包列表工作正常。

于 2019-01-12T00:05:09.070 回答