elpha01
elpha01

Reputation: 306

Cannot build Unity project from command line on fresh git cloned repository

I am looking to build Unity project just after git cloning them. However when they are "fresh" (only not giignored files) the build is very short and has no output. I have to open once the project with Unity Editor to make the build command line working.

Build command line:

 D:/------/Unity.exe -quit -batchmode -logFile uniytBuildLog.txt -buildTarget Win64 -executeMethod AutoBuilder.PerformBuild -appName test.exe -buildFolder "./Build/"

End of build log that seems to be a succes despite a strange error

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

Upvotes: 2

Views: 2766

Answers (1)

elpha01
elpha01

Reputation: 306

One of the problem was due to the lack of the argument with the project path.

I was thinking that skipping this argument would use the project in the current directory but it uses instead the last opened project so it was not building the right one until I open it with the Editor.

Upvotes: 1

Related Questions