Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Error when building game: 'IOException: Sharing violation on path'

Discussion in 'Editor & General Support' started by Blinking_Nora, Jan 3, 2016.

  1. Blinking_Nora

    Blinking_Nora

    Joined:
    Dec 17, 2015
    Posts:
    11
    Hey everyone!

    I have a major issue with my 2d platformer game. It's completely finished now and has worked absolutely fine both in-editor and when building until now. When I press Ctrl + B to build it, the loading bar reaches the end and gives me these errors:

    'IOException: Sharing violation on path Temp\StagingArea\Pippy The Bird.exe" or "C:\Users\Adam\Desktop\Unity Game Build\Pippy The Bird.exe
    System.IO.File.Copy (System.String sourceFileName, System.String destFileName, Boolean overwrite) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.IO/File.cs:124)
    UnityEditor.FileUtil.UnityFileCopy (System.String from, System.String to, Boolean overwrite) (at C:/buildslave/unity/build/Editor/Mono/FileUtil.cs:207)
    UnityEditor.FileUtil.CopyDirectoryFiltered (System.String source, System.String target, Boolean overwrite, System.Func`2 includeCallback, Boolean recursive) (at C:/buildslave/unity/build/Editor/Mono/FileUtil.cs:142)
    DesktopStandalonePostProcessor.CopyStagingAreaIntoDestination () (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/DesktopStandalonePostProcessor.cs:194)
    DesktopStandalonePostProcessor.PostProcess () (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/DesktopStandalonePostProcessor.cs:25)
    UnityEditor.WindowsStandalone.WindowsDesktopStandalonePostProcessor.PostProcess (BuildPostProcessArgs args) (at C:/buildslave/unity/build/PlatformDependent/WinPlayer/Extensions/Managed/WindowsDesktopStandalonePostProcessor.cs:131)
    UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, System.String downloadWebplayerUrl, System.String manualDownloadWebplayerUrl, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:316)
    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()'

    And:


    'Error building Player: IOException: Sharing violation on path Temp\StagingArea\Pippy The Bird.exe" or "C:\Users\Adam\Desktop\Unity Game Build\Pippy The Bird.exe'

    I've even tried building to a folder on two different PCs, and it builds fine with no errors... Until I go to play the exported game and my mouse curser just spins endlessly and it never loads. If I restart windows explorer in task manager it's like I never tried to run the game in the first palce.

    Please can someone help me here! I've literally finished my game for a project now, and the only thing stopping me from being able to hand in is building the thing as a .exe. :/
     
    ZenUnity likes this.
  2. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    926
    i would guess that the game is still open, when the editor tries to overwrite it, while copying it to the target path. Maybe it didn't close properly.
     
    MichaelBGarner likes this.
  3. Blinking_Nora

    Blinking_Nora

    Joined:
    Dec 17, 2015
    Posts:
    11
    I've figured out from restoring from an earlier backup: If I build the game without a custom logo it works fine, however the moment I apply a new picture/texture for the .exe's launcher icon in the Unity Build Settings tab it causes all of these issues. It's completely bizarre, but is something I would like to amend!!
     
    ZenUnity likes this.