Mixedrealitytoolkit-unity: Build Failure due to App Name with Space

Created on 4 Apr 2017  路  12Comments  路  Source: microsoft/MixedRealityToolkit-Unity

I tried a make a build of my HL application using Holotoolkit. The build is successful if App Name doesn't contain spaces. In player settings if i keep "GoogleCloud" as name it works while "Google Cloud" fails the build.

Most helpful comment

I found a bug in this line which may or may not be relevant to this specific bug but it does deal with build failures due to spaces in the project name.

https://github.com/Microsoft/HoloToolkit-Unity/blob/master/Assets/HoloToolkit/Build/Editor/BuildDeployTools.cs#L96

The code reads:
nugetPInfo.Arguments = @"restore " + PlayerSettings.productName + "/project.json";

I would change it to:
nugetPInfo.Arguments = "restore \"" + PlayerSettings.productName + "/project.json\"";

Currently nuget displays the command help since it sees too many arguments to restore, instead of restoring the packages as desired.

All 12 comments

I'm unsure how this relates to the HoloToolkit. Please raise this question over on the Unity HoloLens forums. Thanks.

Maybe trying to build with the build window from HoloToolkit?

I have a space in my project name and it builds just fine.

@StephenHodgson i was trying to automate build process through Command Line (i use it for building via Jenkins) using HoloToolKit. I called the function below to build. The solution (.sln) is generated successfully but the MSBuild part fails.
public static void PerformReleaseBuild() { BuildDeployPrefs.BuildConfig = "Release"; BuildDeployWindow.BuildAndRun(PlayerSettings.productName); }
Here playersettings.productname is just for referring the sln.
playersettings.productname with and without space seems to make a difference for build results.
Thanks for suggestion. I will post in Unity HL Forum as well.

If you are using cmd and Jenkins shouldn't you be formatting the path correctly. Maybe using a backslash for the space in the product name. Or maybe just reject any release name that has a space.

@mattfedocsg 1. Jenkins isn't creating trouble.Problem is before that. When i try building through CMD using holotoolkit provided functions, there it self the build fails when product name has string separated by space.

  1. I can't reject the release because our Product name has a space. I have to find a way out.
    Current, i have manually edited the appx manifest after building the solution which works for now.

That makes a lot more sense now. Haha.
Thanks for the report.

Do you have a sample project and repro steps? I can't seem to get the build to fail using the Build Window.

Are you sure the string you're passing from the cmd line is formatted properly?

Sorry for late reply. PFA the sample project.
Steps to reproduce:

  1. Open the Project and Go to player settings
  2. Enter the 'Product Name' parameter with "Test Project" {or for that matter, any string with two words segregated by space.i.e. "TestProject" -> "Test Project".
  3. Make a build through holotoolkit by choosing "BuildSLN, Build Appx, then Install".
    Outcome: Build Fails
    Surprisingly if i concatenate the names together i.e ("TestProject"), build succceds.
    Unity: 5.5.0f3
    Let me know if you need clarifications
    BuildNameTest.zip

I'm pretty sure this is a issue even when setting in Visual Studio, that the name cannot include white space.

Yeah i think so i tried that but can't remember. Will verify that. Is there a way to separate PlayerSettings.ProductName [Unity] and the name of generated solution.
I guess MSBuild is fails to correctly refer to soln due to spacing in path name.

I found a bug in this line which may or may not be relevant to this specific bug but it does deal with build failures due to spaces in the project name.

https://github.com/Microsoft/HoloToolkit-Unity/blob/master/Assets/HoloToolkit/Build/Editor/BuildDeployTools.cs#L96

The code reads:
nugetPInfo.Arguments = @"restore " + PlayerSettings.productName + "/project.json";

I would change it to:
nugetPInfo.Arguments = "restore \"" + PlayerSettings.productName + "/project.json\"";

Currently nuget displays the command help since it sees too many arguments to restore, instead of restoring the packages as desired.

This solution worked for me.

I have not - yet - found any correlations to other issues.

Was this page helpful?
0 / 5 - 0 ratings