Search Unity

System.IO.DirectoryNotFoundException: Could not find a part of the path ${project_path}\Logs\ApiUpda

Discussion in 'Editor & General Support' started by inemeth, Jun 17, 2021.

  1. inemeth

    inemeth

    Joined:
    Jan 19, 2020
    Posts:
    2
    Hi guys,

    I am about to build my project with Jenkins (using headless unity) and continuously I got the following error:

    System.IO.DirectoryNotFoundException: Could not find a part of the path "$project_path}\Logs\ApiUpdaterCheck.txt".
    at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x00164] in <695d1cc93cca45069c528c15c9fdd749>:0
    at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
    at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
    at System.IO.File.Open (System.String path, System.IO.FileMode mode) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
    at APIUpdater.NonObsoleteApiUpdaterDetector.Program+<Main>d__0.MoveNext () [0x000b2] in <68bff7873e0e4aa69a14dfc30bebbe3e>:0
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <695d1cc93cca45069c528c15c9fdd749>:0
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <695d1cc93cca45069c528c15c9fdd749>:0
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <695d1cc93cca45069c528c15c9fdd749>:0
    at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <695d1cc93cca45069c528c15c9fdd749>:0
    at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
    at APIUpdater.NonObsoleteApiUpdaterDetector.Program.<Main> (System.String[] args) [0x0000c] in <68bff7873e0e4aa69a14dfc30bebbe3e>:0
    [ERROR] FATAL UNHANDLED EXCEPTION: System.IO.DirectoryNotFoundException: Could not find a part of the path "$project_path}\Logs\ApiUpdaterCheck.txt".
    at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x00164] in <695d1cc93cca45069c528c15c9fdd749>:0
    at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
    at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
    at System.IO.File.Open (System.String path, System.IO.FileMode mode) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
    at APIUpdater.NonObsoleteApiUpdaterDetector.Program+<Main>d__0.MoveNext () [0x000b2] in <68bff7873e0e4aa69a14dfc30bebbe3e>:0
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <695d1cc93cca45069c528c15c9fdd749>:0
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <695d1cc93cca45069c528c15c9fdd749>:0
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <695d1cc93cca45069c528c15c9fdd749>:0
    at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <695d1cc93cca45069c528c15c9fdd749>:
    at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
    at APIUpdater.NonObsoleteApiUpdaterDetector.Program.<Main> (System.String[] args) [0x0000c] in <68bff7873e0e4aa69a14dfc30bebbe3e>:0


    When I use the Unity Build option (of course in running Unity Editor) there is no problem, only the aforementioned case.

    This is the command I make Jenkins use:
    Unity -accept-apiupdate -quit -batchmode -nographics -executeMethod "%execute_method%" -logfile "Build\%version%\log\build.log" -buildWindowsPlayer "Build/Win/project/version-v%.version%project.exe"

    Is there a bug in https://docs.unity3d.com/Manual/APIUpdater.html when Unity is used in terminal mode?

    Thank you for the help in advance.
    István
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,697
    The first thing that jumps out at me is the single-backslashes... is that right? Can you make it forward slash? OR double-backslash for escape?
     
    inemeth likes this.