我想在git克隆它们后立即构建Unity项目。但是,当它们是“新鲜的”(仅不是经过忽略的文件)时,构建非常短并且没有输出。我必须使用Unity Editor打开项目才能使构建命令行正常工作。
构建命令行:
D:/------/Unity.exe -quit -batchmode -logFile uniytBuildLog.txt -buildTarget Win64 -executeMethod AutoBuilder.PerformBuild -appName test.exe -buildFolder "./Build/"
尽管有一个奇怪的错误,构建日志结尾似乎还是成功的
Reloading assemblies after script compilation.
Begin MonoManager ReloadAssembly
Refreshing native plugins compatible for Editor in 3.09 ms, found 7 plugins.
Preloading 2 native plugins for Editor in 0.15 ms.
Mono: successfully reloaded assembly
Refreshing native plugins compatible for Editor in 0.79 ms, found 7 plugins.
Preloading 2 native plugins for Editor in 0.11 ms.
----- Total AssetImport time: 0.130863s, AssetImport time: 0.000000s, Asset hashing: 0.000000s [0 B, 0.000000 mb/s]
- Completed reload, in 1.564 seconds
Initializing Unity.PackageManager (PackageManager) v2017.2.1 for Unity v2017.2.1f1
Registering platform support modules:
Registered platform support modules in: 0.0496396s.
Native extension for OSXStandalone target not found
Native extension for WindowsStandalone target not found
Native extension for LinuxStandalone target not found
Native extension for WebGL target not found
Native extension for Metro target not found
Native extension for iOS target not found
Native extension for Android target not found
Batchmode quit successfully invoked - shutting down!
Refresh: detecting if any assets need to be imported or removed ... Refresh: elapses 0.046037 seconds (Nothing changed)
Updating ProjectSettings/ProjectSettings.asset - GUID: 00000000000000004000000000000000...
done. [Time: 61.503121 ms]
Refreshing native plugins compatible for Editor in 1.32 ms, found 7 plugins.
Preloading 2 native plugins for Editor in 0.12 ms.
----- Total AssetImport time: 0.196505s, AssetImport time: 0.107053s, Asset hashing: 0.000000s [0 B, 0.000000 mb/s]
Refresh: detecting if any assets need to be imported or removed ... Refresh: elapses 0.032108 seconds (Nothing changed)
[Package Manager] Server::Kill -- Server was shutdown
Cleanup mono
[usbmuxd] Stop listen thread
[usbmuxd] Listen thread exiting
Exiting batchmode successfully now!
Unhandled Exception: System.IO.DirectoryNotFoundException: Directory 'C:\Users\Ben\AppData\Local\Temp\160279e2' not found.
at System.IO.Directory.GetFileSystemEntries (System.String path, System.String searchPattern, FileAttributes mask, FileAttributes attrs) [0x000f7] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Directory.cs:514
at System.IO.Directory.GetDirectories (System.String path, System.String searchPattern) [0x00000] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Directory.cs:275
at System.IO.Directory.GetDirectories (System.String path) [0x00000] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Directory.cs:270
at System.IO.Directory.RecursiveDelete (System.String path) [0x00000] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Directory.cs:186
at System.IO.Directory.Delete (System.String path, Boolean recursive) [0x0000c] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Directory.cs:205
at System.CodeDom.Compiler.TempFileCollection.Delete () [0x00000] in <filename unknown>:0
at System.CodeDom.Compiler.TempFileCollection.Dispose (Boolean disposing) [0x00000] in <filename unknown>:0
at System.CodeDom.Compiler.TempFileCollection.Finalize () [0x00000] in <filename unknown>:0
debugger-agent: Unable to listen on 3896
答案 0 :(得分:0)
问题之一是由于项目路径缺少参数。
我当时想跳过此参数将使用当前目录中的项目,但它使用的是上次打开的项目,因此直到我用编辑器打开它之前,它才构建正确的项目。