Reputation: 11712
I have a UWP app which I ported to iOS & Android using the Uno platform. I can build and run the iOS project on my Windows but when I try to run it on my Mac, I'm getting the following error:
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.
Even if I add the reference to this package, the error stays and I'm unable to run the project. The full stacktrace is below:
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)
I'm using the latest release version of the Uno.Platform (not pre-released):
<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" />
Is it possible to run an iOS app, developed using the Uno platform on Mac?
Upvotes: 1
Views: 345
Reputation: 11712
I tried to update the Uno.UI package to the latest pre-release - it didn't help. I had to update not only the Uno.UI package but also manually update all the related packages which were not pulled with the 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" />
This list of packages works fine.
Upvotes: 0
Reputation: 46
As Andres mentioned, this has been fixed in the latest dev. You can get additional help if need be on our Gitter channel: https://gitter.im/uno-platform/Lobby#
Upvotes: 3