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
  4. Dismiss Notice

BuildFailedException: Deployment failed

Discussion in 'Editor & General Support' started by Ninetails1410, May 28, 2020.

  1. Ninetails1410

    Ninetails1410

    Joined:
    Sep 27, 2013
    Posts:
    2
    So I'm trying to build a UWP project in debug mode and I get the following error:

    Code (CSharp):
    1.  
    2. BuildFailedException: Deployment failed.
    3. Output:System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\colel\Documents\UnityProjects\AREngine1\Build_1\build\bin\x64\Debug\AppX\AppxManifest.xml'.
    4.    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
    5.    at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
    6.    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
    7.  
    I'm pretty sure my UWP sdk is properly installed and if not, I'm not sure how to fix the installation. I see that this has been reported as a known bug in the past, but it was supposedly fixed in 2019.1. Anyone have any ideas that might help me fix this issue?

    Thanks
     
  2. DiegoDePalacio

    DiegoDePalacio

    Unity Technologies

    Joined:
    Oct 28, 2009
    Posts:
    506
    Hi @Ninetails1410,

    I have some ideas that you can check in order to found a solution:
    • Try to build a sample / simple project to verify if it's something related to the installation or to your current project;
    • Check if the Directory mentioned in the error exists;
    • Try running Unity as Administrator to find out if it's something related to a lack of write permissions on the folder where you're trying to create your build.

    Good luck with it!
     
  3. Fenix_Abbott

    Fenix_Abbott

    Joined:
    Jun 4, 2020
    Posts:
    4
    I have the same issue that he had. I am relatively new to all of this, so I don't know how to do what your are talking about. I did try to run a build of another project and I got the same error.
     
    Last edited: Jun 4, 2020
  4. DiegoDePalacio

    DiegoDePalacio

    Unity Technologies

    Joined:
    Oct 28, 2009
    Posts:
    506
  5. tsibiski

    tsibiski

    Joined:
    Jul 11, 2016
    Posts:
    569
    The problem appears to be that Unity is generating and placing the AppManifest.xml file one level above where it then looks for the file. There is no AppX folder created. And since these are temp files and folders, manually creating the AppX folder, and dragging the manifest into it, does not appear to work. This seems to be a bug.
     
    Arik_Cool likes this.
  6. timke

    timke

    Unity Technologies

    Joined:
    Nov 30, 2017
    Posts:
    395
    tsibiski likes this.
  7. tsibiski

    tsibiski

    Joined:
    Jul 11, 2016
    Posts:
    569
    kenkoh33 likes this.
  8. timke

    timke

    Unity Technologies

    Joined:
    Nov 30, 2017
    Posts:
    395
    Glad to hear you're able to work around it.

    I'll update and the bug to help expedite the backports and also schedule a backport for 2019 LTS.
     
    tsibiski likes this.
  9. Arik_Cool

    Arik_Cool

    Joined:
    Jul 28, 2020
    Posts:
    8
    I am still having this issue
    I tried everything from switching windows SDK to a minimum but no luck.

    ERROR DETAILS:
    BuildFailedException: Deployment failed.
    Output:System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\1 DriveFree\Temporary Files\build\bin\x64\Release\AppX\AppxManifest.xml'.
    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
    at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
    at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy)
    at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
    at System.Xml.XmlTextReaderImpl.FinishInitUriString()
    at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext)
    at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options)
    at WindowsPhonePlayerRunner.AppxManifest..ctor(String appxPath)
    at WindowsPhonePlayerRunner.AppxManifest.Get(String appxPath)
    at UWPPlayerLauncher.Program.Run(ProgramArguments arguments)
    at UWPPlayerLauncher.Program.Main(String[] args)
    ApplicationLauncherImpl.RunOnLocalMachine (System.String commandLine) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ApplicationLauncher.cs:389)
    ApplicationLauncherImpl.Run (Utility+VisualStudio vs) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ApplicationLauncher.cs:350)
    ApplicationLauncher.BuildAndRunProject (UnityEditor.Modules.BuildLaunchPlayerArgs args, UnityEditor.WSABuildAndRunDeployTarget deployTarget, System.String platform, Utility+VisualStudio vs) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ApplicationLauncher.cs:71)
    ApplicationLauncher.BuildAndRun (UnityEditor.Modules.BuildLaunchPlayerArgs args) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ApplicationLauncher.cs:39)
    UnityEditor.UWP.BuildPostprocessor.LaunchPlayer (UnityEditor.Modules.BuildLaunchPlayerArgs args) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ExtensionModule.cs:78)
    UnityEditor.PostprocessBuildPlayer.Launch (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget buildTarget, System.String path, System.String productName, UnityEditor.BuildOptions options, UnityEditor.Build.Reporting.BuildReport buildReport) (at <5ad584e208e14caaa9e6b2e6027e9204>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)
     
  10. timke

    timke

    Unity Technologies

    Joined:
    Nov 30, 2017
    Posts:
    395
    @Arik_Cool

    Just to confirm, did you select in the Unity Build Settings dialogue a Minimum SDK of 10.0.17134.12 or earlier?

    It doesn't so much matter which Windows SDKs you have installed (you can have them all installed if you want), but to work around the bug you must set the older SDK version within Build Settings.

    Also, can you please post the path of the appx package when during a Build & Run (via Device Portal). That is, what's the actual path of the AppxManifest.xml file in your build output? This will help confirm it's the same bug and not some other issue.

    Lastly, I saw the fix still hasn't been backported to 2019.4 yet. I apologize for the delay (didn't realize it was stalled) and will take on this work myself.
     
  11. Arik_Cool

    Arik_Cool

    Joined:
    Jul 28, 2020
    Posts:
    8
    @timke

    I don't know what the problem was but I actually solved it indirectly; I reinstalled the unity Editor and Transferred all the scenes and assets in the new Project I created. You need to create a new project after installing the Editor and then transfer Scenes and Assets to the new project but don't transfer any settings. This solved the problem or it may be a bit of luck. Try yourself to find out.
     
  12. timke

    timke

    Unity Technologies

    Joined:
    Nov 30, 2017
    Posts:
    395
    I'm really glad you're able to find a work around...but what a mess :(

    It sounds like something got screwed up in the UWP project settings and maybe wasn't using the SDK version specified in the Build Settings. But that's just a guess.

    The good news is the backport PRs are in flight and hopefully will land for the next 2019 and 2020 LTS patch releases.