microsoft / MixedRealityToolkit-Unity

This repository is for the legacy Mixed Reality Toolkit (MRTK) v2. For the latest version of the MRTK please visit https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity
https://aka.ms/mrtkdocs
MIT License
6k stars 2.12k forks source link

Failed to resolve assembly UniversalApiContract #6117

Closed Maikyl closed 4 years ago

Maikyl commented 4 years ago

Since upgrading from HoloToolkit to Mixed Reality Toolkit, I am unable to build for hololens. The error unity throws is:

Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Windows.Foundation.UniversalApiContract, Version=8.0.0.0, Culture=neutral, PublicKeyToken=null'
   at Mono.Cecil.BaseAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters)
   at Burst.Compiler.IL.AssemblyLoader.Resolve(AssemblyNameReference name)
   at Burst.Bcl.BclApp.LoadAllAssemblyReferences(AssemblyDefinition asmDef, Dictionary2 visited)
   at Burst.Bcl.BclApp.LoadAllAssemblyReferences(AssemblyDefinition asmDef, Dictionary2 visited)
   at Burst.Bcl.BclApp.FindExecuteMethods(List`1 rootAssemblyPaths)
   at Burst.Bcl.BclApp.GetMethodsToCompile()
   at Burst.Bcl.Program.Main(String[] args)

The scene itself is mostly empty, containing only the required gameobjects for MRTK (Directional Light, MixedRealityToolkit and MixedRealityPlayspace, which has the Main Camera as child.)

Unity version 2019.2.6, SDK version 10.0.18362.0

Building a test scene from the MRTK works fine, so it must have something to do with our project.

keveleigh commented 4 years ago

This looks like the same call stack reported in https://github.com/microsoft/MixedRealityToolkit-Unity/issues/6098. Are you on the latest version of Burst, where it seems like this should be fixed (and it'd be good to know if you start hitting this after as well)?

Maikyl commented 4 years ago

I'm at home right now, but I will get back to you first thing Monday morning.

Maikyl commented 4 years ago

After updating Burst to 1.2.0-preview.5, I am indeed getting the second error in that issue report.

Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Windows.Foundation.FoundationContract, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null'
   at Mono.Cecil.BaseAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters)
   at Burst.Compiler.IL.AssemblyLoader.Resolve(AssemblyNameReference name)
   at Mono.Cecil.MetadataResolver.Resolve(TypeReference type)
   at Mono.Cecil.TypeReference.Resolve()
   at Burst.Bcl.BclApp.FindExecuteMethods(List 1 rootAssemblyPaths)
   at Burst.Bcl.BclApp.GetMethodsToCompileBeforeDynamicDispatch()
   at Burst.Bcl.BclApp.GetMethodsToCompile()
   at Burst.Bcl.Program.Main(String[] args)
keveleigh commented 4 years ago

Thanks for the update! I'm going to close this as a duplicate of #6098, which has some additional discussion and a Unity dev on the thread. Please add any additional info you'd like over there.