编译unity 2017报错记录

1. 编译报错

Unhandled Exception:
System.TypeInitializationException: The type initializer for 'Unity.BuildTools.Paths' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object
  at Unity.BuildTools.Paths..cctor () [0x0000f] in I:\unity2017\Unity2017.4.17f1\Tools\Unity.BuildSystem\Unity.BuildTools\Paths.cs:11
  at Driver.Main () [0x0002d] in I:\unity2017\Unity2017.4.17f1\Tools\Unity.BuildSystem\Unity.BuildSystem.Driver\Main.cs:30
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'Unity.BuildTools.Paths' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object
  at Unity.BuildTools.Paths..cctor () [0x0000f] in I:\unity2017\Unity2017.4.17f1\Tools\Unity.BuildSystem\Unity.BuildTools\Paths.cs:11
  at Driver.Main () [0x0002d] in I:\unity2017\Unity2017.4.17f1\Tools\Unity.BuildSystem\Unity.BuildSystem.Driver\Main.cs:30
executing jam failed with this cmdline: -sJAMFILE=Pass1.jam Pass1 -fH:/unity2017/Unity2017.4.17f1/Tools/Unity.BuildSystem/Unity.BuildSystem/JamEntryPoint.jam at H:\unity2017\Unity2017.4.17f1\jam.pl line 303.
Failed jamming PrepareWorkingCopy at Tools/Build/PrepareWorkingCopy.pm line 59.

可能原因1:没有装visual studio 2010 sp1

可能原因2:装了vs 2010 sp1后,没有触发编译脚本的重编译,把Unity源码目录下的临时文件删除重新生成即可。或者手动改一下源码目录下的Tools\Unity.BuildSystem\Unity.BuildTools\Paths.cs,触发一次编译系统重编译。

2. 为windows编译mono.dll

  • checkout https://github.com/cgsgood/dnSpy-Unity-mono
  • 找到unity版本对应mono,打开msvc/mono.sln,选择Release_eglib的Configure,编译即可
  • 生成的mono.dll在builds\embedruntimes\win64\目录,复制到Unity源码External\Mono\builds.zip对应的平台里面
  • 重新编译Unity

你可能感兴趣的:(编译unity 2017报错记录)