SiliconStudio / xenko

Old repo for Xenko Game Engine. Please use https://github.com/xenko3d/xenko instead.
http://xenko.com
1.54k stars 343 forks source link

[1.7.1] Fails to build with System.NullReferenceException #430

Open gitfool opened 8 years ago

gitfool commented 8 years ago

I can't seem to build the latest source. I get two errors like the following:

9>AssetCompiler : error 11.075s: Exception in command Asset build steps [SpriteFontAsset:'DynamicFonts/MSMincho10'] (1 items): System.NullReferenceException: Object reference not set to an instance of an object.
9>     at SiliconStudio.Assets.Compiler.AssetCommand`1.ToString() in D:\Devel\Repos\Xenko\sources\assets\SiliconStudio.Assets\Compiler\AssetCommand.cs:line 93
9>     at SiliconStudio.BuildEngine.CommandBuildStep.ToString() in D:\Devel\Repos\Xenko\sources\common\buildengine\SiliconStudio.BuildEngine.Common\CommandBuildStep.cs:line 50
9>     at SiliconStudio.BuildEngine.BuildStep.get_Description() in D:\Devel\Repos\Xenko\sources\common\buildengine\SiliconStudio.BuildEngine.Common\BuildStep.cs:line 47
9>     at SiliconStudio.BuildEngine.BuildThreadMonitor.RegisterBuildStep(BuildStep buildStep, TimestampLocalLogger logger) in D:\Devel\Repos\Xenko\sources\common\buildengine\SiliconStudio.BuildEngine.Common\BuildThreadMonitor.cs:line 96
9>     at SiliconStudio.BuildEngine.Builder.ScheduleBuildStep(BuilderContext builderContext, BuildStep instigator, BuildStep buildStep, IDictionary`2 variables) in D:\Devel\Repos\Xenko\sources\common\buildengine\SiliconStudio.BuildEngine.Common\Builder.cs:line 347
9>     at SiliconStudio.BuildEngine.Builder.ExecuteContext.ScheduleBuildStep(BuildStep step) in D:\Devel\Repos\Xenko\sources\common\buildengine\SiliconStudio.BuildEngine.Common\Builder.cs:line 237
9>     at SiliconStudio.BuildEngine.EnumerableBuildStep.<Execute>d__17.MoveNext() in D:\Devel\Repos\Xenko\sources\common\buildengine\SiliconStudio.BuildEngine.Common\EnumerableBuildStep.cs:line 63
9>  --- End of stack trace from previous location where exception was thrown ---
9>     at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
9>     at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
9>     at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
9>     at SiliconStudio.BuildEngine.Builder.<>c__DisplayClass64_2.<<ScheduleBuildStep>b__0>d.MoveNext() in D:\Devel\Repos\Xenko\sources\common\buildengine\SiliconStudio.BuildEngine.Common\Builder.cs:line 373
9>AssetCompiler : error 11.084s: Exception in command Asset build steps [SpriteFontAsset:'DynamicFonts/Meiryo14'] (1 items): System.NullReferenceException: Object reference not set to an instance of an object.
9>     at SiliconStudio.Assets.Compiler.AssetCommand`1.ToString() in D:\Devel\Repos\Xenko\sources\assets\SiliconStudio.Assets\Compiler\AssetCommand.cs:line 93
9>     at SiliconStudio.BuildEngine.CommandBuildStep.ToString() in D:\Devel\Repos\Xenko\sources\common\buildengine\SiliconStudio.BuildEngine.Common\CommandBuildStep.cs:line 50
9>     at SiliconStudio.BuildEngine.BuildStep.get_Description() in D:\Devel\Repos\Xenko\sources\common\buildengine\SiliconStudio.BuildEngine.Common\BuildStep.cs:line 47
9>     at SiliconStudio.BuildEngine.BuildThreadMonitor.RegisterBuildStep(BuildStep buildStep, TimestampLocalLogger logger) in D:\Devel\Repos\Xenko\sources\common\buildengine\SiliconStudio.BuildEngine.Common\BuildThreadMonitor.cs:line 96
9>     at SiliconStudio.BuildEngine.Builder.ScheduleBuildStep(BuilderContext builderContext, BuildStep instigator, BuildStep buildStep, IDictionary`2 variables) in D:\Devel\Repos\Xenko\sources\common\buildengine\SiliconStudio.BuildEngine.Common\Builder.cs:line 347
9>     at SiliconStudio.BuildEngine.Builder.ExecuteContext.ScheduleBuildStep(BuildStep step) in D:\Devel\Repos\Xenko\sources\common\buildengine\SiliconStudio.BuildEngine.Common\Builder.cs:line 237
9>     at SiliconStudio.BuildEngine.EnumerableBuildStep.<Execute>d__17.MoveNext() in D:\Devel\Repos\Xenko\sources\common\buildengine\SiliconStudio.BuildEngine.Common\EnumerableBuildStep.cs:line 63
9>  --- End of stack trace from previous location where exception was thrown ---
9>     at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
9>     at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
9>     at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
9>     at SiliconStudio.BuildEngine.Builder.<>c__DisplayClass64_2.<<ScheduleBuildStep>b__0>d.MoveNext() in D:\Devel\Repos\Xenko\sources\common\buildengine\SiliconStudio.BuildEngine.Common\Builder.cs:line 373

BuildLog.zip

I tried on another machine with Windows 7 x64 and it worked.

gitfool commented 8 years ago

Those fonts were missing from my Windows 10 machine. I had to install an optional feature with the Japanese Supplemental Fonts. (See here.)

This could've been handled better than via a NRE. Not a great user experience. :stuck_out_tongue_winking_eye:

At least it builds now!

LautrecOfCarim commented 8 years ago

Hi,

Thanks for the report and sorry for the inconvenience! I'll investigate if we can bundle the font assets or make the test builds optional to avoid this kind of problem.

gitfool commented 8 years ago

... or just return a more specific error that the font is missing and needs to be installed.

LautrecOfCarim commented 8 years ago

We made two changes which should be out with the next update. First, the asset compiler will display an error on the error stream and the asset errors window in the game studio when you try to build a font asset with a missing font. Also, the tests now use a different font file which is bundled together to avoid compilation errors when you first build the solution.