hl2ss icon indicating copy to clipboard operation
hl2ss copied to clipboard

Getting NullReferenceException when trying to build and run the Unity sample project

Open fmatulic opened this issue 2 months ago • 3 comments

I'm getting a NullReferenceException error in your BuildPostProcessor script when I try to build and run your sample Unity project. Here's the full trace:

NullReferenceException: Object reference not set to an instance of an object
BuildPostProcessor.AddCapability (System.Xml.XmlDocument xml, System.String name, System.String capability, System.String namespaceURI, System.Boolean append) (at Assets/Editor/BuildPostProcessor.cs:12)
BuildPostProcessor.OnPostprocessBuild (UnityEditor.BuildTarget target, System.String pathToBuiltProject) (at Assets/Editor/BuildPostProcessor.cs:33)
System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <b11ba2a8fbf24f219f7cc98532a11304>:0)

Looking in the BuildPostProcessor script, it appears it can't find the "Capabilities" tag in "Package.appxmanifest" and indeed when I open the file that tag is absent. Adding it manually solved the problem, but maybe you want to add that in your BuildPostProcessor script.

Ok, but now I have another problem. After the application starts on the HoloLens, a movements access permission window is briefly shown along with what looks like the MRTK's visual profiler and then the application suddenly quits.

fmatulic avatar Apr 23 '24 11:04 fmatulic