Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fmatulic opened this issue Apr 23, 2024 · 3 comments

Comments

@fmatulic
Copy link

fmatulic commented Apr 23, 2024

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.

@jdibenes
Copy link
Owner

Hello,
What Unity version are you using?

@fmatulic
Copy link
Author

Sorry for forgetting to mention that piece of info. I'm on Unity 2022, which I know isn't the version you used for the project.

@jdibenes
Copy link
Owner

I tried building the Unity sample on Unity 2022.
Enabling Sync Capabilities in Project Settings > Player > Publishing Settings fixes the NullReferenceException error and the app seems to run correctly on the HoloLens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants