microsoft / ProjectAcoustics

Microsoft Project Acoustics
https://aka.ms/acoustics
Creative Commons Attribution 4.0 International
141 stars 22 forks source link

Unity Build with MRTK + OpenXR + Acoustics fails due to dependency issues #67

Open jmfranz opened 3 years ago

jmfranz commented 3 years ago

From the demos of acoustics 2 I thought it should be compatible with HL2 builds; however, the build fails due to missing numerics.vectors dependency.

Unity Version: 2020.3.16f1 MRTK Version: 2.7 Acoustics: Latest on aka.ms

Error message:

Fatal error in Unity CIL Linker
Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'System.Numerics.Vectors, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null'
MikeChemi commented 3 years ago

Hey @jmfranz can you provide a bit more information? Does the project work in-editor at all? Are you targeting ARM or ARM64 for the HoloLens build?

We tried this internally and don't see the missing System.Numerics.Vectors issue, although we have seen #65

jmfranz commented 3 years ago

Hi @MikeChemi, it works in the editor. I've downloaded the sample again today and added it to an empty project together with the MRTK and OpenXR.

Unity 2020.3.15f2 Target HoloLens on ARM64 SDK set to 10.0.19041.0 on Release It fails with Net 4.x and Standard 2.0 Here is the full error:

Exception: Failed running C:\Program Files\Unity\Hub\Editor\2020.3.15f2\Editor\Data\il2cpp\build/deploy/netcoreapp3.1/UnityLinker.exe @C:/Users/Franz/Desktop/ProjectAcoustics/AcousticsSample/Temp/StagingArea/Data/Managed/response.rsp

stdout: Fatal error in Unity CIL Linker Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'System.Numerics.Vectors, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null' at Unity.IL2CPP.Common.MissingMethodStubber.GetTypeModule(TypeReference type, IEnumerable`1 assemblies) at Unity.Linker.Steps.AddUnresolvedStubsStep.MarkAssemblyOfType(UnityLinkContext context, TypeReference type) at Unity.Linker.Steps.Marking.UnresolvedStubMarking.HandleUnresolvedType(TypeReference reference) at Unity.Linker.Steps.UnityMarkStep.HandleUnresolvedType(TypeReference reference) at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference) at Mono.Linker.Steps.MarkStep.MarkField(FieldDefinition field) at Mono.Linker.Steps.MarkStep.MarkFields(TypeDefinition type, Boolean includeStatic, Boolean markBackingFieldsOnlyIfPropertyMarked) at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference) at Mono.Linker.Steps.MarkStep.MarkField(FieldDefinition field) at Mono.Linker.Steps.MarkStep.MarkFields(TypeDefinition type, Boolean includeStatic, Boolean markBackingFieldsOnlyIfPropertyMarked) at Mono.Linker.Steps.MarkStep.ApplyPreserveInfo(TypeDefinition type) at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference) at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference) at Mono.Linker.Steps.MarkStep.InitializeType(TypeDefinition type) at Mono.Linker.Steps.MarkStep.InitializeType(TypeDefinition type) at Mono.Linker.Steps.MarkStep.InitializeAssembly(AssemblyDefinition assembly) at Unity.Linker.Steps.UnityMarkStep.InitializeAssembly(AssemblyDefinition assembly) at Mono.Linker.Steps.MarkStep.Initialize() at Mono.Linker.Steps.MarkStep.Process(LinkContext context) at Unity.Linker.Steps.UnityMarkStep.Process(LinkContext context) at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step) at Unity.Linker.UnityPipeline.ProcessStep(LinkContext context, IStep step) at Mono.Linker.Pipeline.Process(LinkContext context) at Unity.Linker.UnityDriver.UnityRun(ILogger customLogger) at Unity.Linker.UnityDriver.RunDriverWithoutErrorHandling(ILogger customLogger) at Unity.Linker.UnityDriver.RunDriver() stderr:

UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at <44c3723143904fb88deebc993c7bb491>:0) UnityEditorInternal.Runner.RunNetCoreProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action1[T] setupStartInfo) (at <44c3723143904fb88deebc993c7bb491>:0) UnityEditorInternal.AssemblyStripper.RunAssemblyLinker (System.Collections.Generic.IEnumerable1[T] args, System.String& out, System.String& err, System.String linkerPath, System.String workingDirectory) (at <44c3723143904fb88deebc993c7bb491>:0) UnityEditorInternal.AssemblyStripper.StripAssembliesTo (System.String outputFolder, System.String& output, System.String& error, System.Collections.Generic.IEnumerable1[T] linkXmlFiles, UnityEditorInternal.UnityLinkerRunInformation runInformation) (at <44c3723143904fb88deebc993c7bb491>:0) UnityEditorInternal.AssemblyStripper.RunAssemblyStripper (UnityEditorInternal.UnityLinkerRunInformation runInformation) (at <44c3723143904fb88deebc993c7bb491>:0) UnityEditorInternal.AssemblyStripper.StripAssemblies (System.String managedAssemblyFolderPath, UnityEditorInternal.BaseUnityLinkerPlatformProvider unityLinkerPlatformProvider, UnityEditorInternal.IIl2CppPlatformProvider il2cppPlatformProvider, UnityEditor.RuntimeClassRegistry rcr, UnityEditor.ManagedStrippingLevel managedStrippingLevel) (at <44c3723143904fb88deebc993c7bb491>:0) UnityEditorInternal.IL2CPPBuilder.Run () (at <44c3723143904fb88deebc993c7bb491>:0) UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String tempFolder, System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at <44c3723143904fb88deebc993c7bb491>:0) PostProcessWinRT.RunIL2CPPForProjectBuild () (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1909) PostProcessWinRT.RunIL2CPP () (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1878) PostProcessWinRT.Process () (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:211) UnityEditor.UWP.BuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ExtensionModule.cs:86) Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown. UnityEditor.UWP.BuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ExtensionModule.cs:90) UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <44c3723143904fb88deebc993c7bb491>:0) UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <44c3723143904fb88deebc993c7bb491>:0) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

MikeChemi commented 3 years ago

Thanks for the additional information. Off-hand, I'm surprised to see this, since we only need the managed DLLs for in-editor baking. If anything, I'd expect the editor to have issues, but the build-for-device to be OK.

We'll dig in on our side, but I don't have a good estimate of when we'll have more information to share. In the meantime, you can try deleting the entire Acoustics/Editor folder prior to building for HoloLens, since that is where all the managed code lives which shouldn't be necessary for deploying Project Acoustics to the HoloLens.

jmfranz commented 3 years ago

@MikeChemi thanks for the suggestion. Confirming no issues compiling after deleting the Editor folder.

To be honest, I thought Unity would ignore everything in the Editor folder during a build.

Thanks!