Deployment failed - Must specify an appx file to install

Unity version : 2019.4.4

I’m trying to deploy an unity UWP app to Hololens2 using device portal.

When I “Build And Run” the project in unity Build Settings window, BuildFailedException happens.

The process of building the app works fine, but I think there is a problem with the deployment process.

So if I open the built project directly in Visual Studio 2019 and deploy it to the device, deployment works perfectly fine.

This problem keeps bottlenecks in the development-test iteration process.

I wanted to see if my project source was a problem, but after creating a new project and following the hololens2 tutorial(HoloLens 2 fundamentals: develop mixed reality applications - Training | Microsoft Learn), I still get the same problem.

I don’t even know what the broken characters in that error log is…

Can someone please tell me how to fix this?


BuildFailedException: Deployment failed.
Output:System.ArgumentNullException: ���� null�� �� �����ϴ�.
�Ű� ���� �̸�: Must specify an appx file to install
��ġ: DevicePortalTool.AppOperation.ExecuteInstallOperation(ParameterHelper parameters)
��ġ: DevicePortalTool.AppOperation.ExecuteOperationInternal(Operation op, ParameterHelper parameters)

Build completed with a result of ‘Failed’ in 82 seconds (81633 ms)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002bb] in :0
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in :0
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Can you attach the complete editor log please? Which project build type are you using? Did you try using “Executable Only”?

What I wrote above is all of my editor logs6174202--675826--error_capture.PNG

I set up build type to “D3D Project” as in the hl2 tutorial document.

That’s not the editor log. You can find the editor logs here: Unity - Manual: Log files

ohh. here is my complete editor log.

6178293–676500–Editor.log.txt (1010 KB)

Do you know if the build actually gets produced in the folder you specified? Could you show me the files inside? Unfortunately the log didn’t contain much to work with so I’m still trying to understand what is happening.

As far as I know, there is no problem until the build. When I deploy the Unity build to the HL2 device using Visual Studio, it works fine.

files in ./build

6186397–678085–tree_build_dir.txt (164 KB)

I guess the error is the same one as I am getting while trying to build using UWP for Xbox:

BuildFailedException: Deployment failed.
Output:System.ArgumentNullException: Value cannot be null.
Parameter name: Must specify an appx file to install
   at DevicePortalTool.AppOperation.ExecuteInstallOperation(ParameterHelper parameters)
   at DevicePortalTool.AppOperation.ExecuteOperationInternal(Operation op, ParameterHelper parameters)
ExitCode: -1 (OperationFailed)
ApplicationLauncherImpl.RunOnDevicePortalDevice (System.String appxPath, System.String playerPackage) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ApplicationLauncher.cs:441)
ApplicationLauncherImpl.Run (Utility+VisualStudio vs) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ApplicationLauncher.cs:362)
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:77)
UnityEditor.PostprocessBuildPlayer.Launch (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget buildTarget, System.String path, System.String productName, UnityEditor.BuildOptions options, UnityEditor.Build.Reporting.BuildReport buildReport) (at <6776482ad98c481c9322bc7e45bcbc33>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

As far as I can see under Game/build/bin/x64/ folder the project has been generated, but when trying to open .exe file it throws an error:

Can you report a bug on this? There is clearly something wrong in how Unity tries to deploy the app.

Uploading the report!
Tried to build and run on a remote xbox device using a new project with a single cube the result is the same. The project is attached on the bug report with the build settings.

Cool. Could you also try switching to “Executable Only” build mode to see if that makes any difference?

Trying with ‘Executrable Only’ build type throws more errors:

Failed running C:\Program Files\Unity\Hub\Editor\2019.4.7f1\Editor\Data\il2cpp/build/deploy/net471/il2cpp.exe --convert-to-cpp --emit-null-checks --enable-array-bounds-check --dotnetprofile="unityaot" --compile-cpp --libil2cpp-static --platform="WinRT" --architecture="x64" --configuration="Release" --outputpath="C:\Users\Creator\Desktop\sworkspace\Clients\Unity\commandos\Temp\StagingArea\Data\Native\GameAssembly.dll" --cachedirectory="C:\Users\Creator\Desktop\sworkspace\Clients\Unity\commandos\Assets\..\Library\UWP\x64\Release/il2cpp_cache" --relative-data-path=Data/il2cpp_data --profiler-report --map-file-parser="C:/Program Files/Unity/Hub/Editor/2019.4.7f1/Editor/Data/Tools/MapFileParser/MapFileParser.exe" --directory=C:/Users/Creator/Desktop/sworkspace/Clients/Unity/commandos/Temp/StagingArea/Data/Managed --generatedcppdir=C:/Users/Creator/Desktop/sworkspace/Clients/Unity/commandos/Temp/StagingArea/Data/il2cppOutput

stdout:
Building GameAssembly.dll with MsvcWinRtToolChain
    Msvc Install Version: 15.0
    Msvc Install SDK Directory: C:\Program Files (x86)\Windows Kits\10
    Msvc Linker Path: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64\link.exe
    Msvc Compiler Path: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64\cl.exe

    Output directory: C:\Users\Creator\Desktop\sworkspace\Clients\Unity\commandos\Temp\StagingArea\Data\Native
    Cache directory: C:\Users\Creator\Desktop\sworkspace\Clients\Unity\commandos\Library\UWP\x64\Release\il2cpp_cache
il2cpp.exe didn't catch exception: Unity.IL2CPP.Building.BuilderFailedException: Il2CppTypeDefinitions.c
C:\Program Files\Unity\Hub\Editor\2019.4.7f1\Editor\Data\il2cpp\libil2cpp\il2cpp-config.h(3): fatal error C1083: Cannot open include file: 'assert.h': No such file or directory

Invocation was: Executable: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64\cl.exe"
Arguments: "C:\Users\Creator\Desktop\sworkspace\Clients\Unity\commandos\Temp\StagingArea\Data\il2cppOutput\Il2CppTypeDefinitions.c" /nologo /c /bigobj /W3 /Zi /EHs /GR- /Gy /utf-8 /wd4102 /wd4800 /wd4056 /wd4190 /wd4723 /wd4467 /wd4503 /wd4996 /wd4200 /Ox /Oi /Oy- /GS- /Gw /GF /Zo /MD /DNET_4_0 /DUNITY_AOT /DIL2CPP_MONO_DEBUGGER_DISABLED /DGC_NOT_DLL /DRUNTIME_IL2CPP /DIL2CPP_DEFAULT_DATA_DIR_PATH=Data/il2cpp_data /D_WIN32 /DWIN32 /DWIN32_THREADS /D_WINDOWS /DWINDOWS /D_UNICODE /DUNICODE /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS /D_WINSOCK_DEPRECATED_NO_WARNINGS /DNOMINMAX /D_NDEBUG /DNDEBUG /DWINDOWS_SDK_BUILD_VERSION=19041 /D__WRL_NO_DEFAULT_LIB__ /DWINAPI_FAMILY=WINAPI_FAMILY_APP /I"C:\Program Files\Unity\Hub\Editor\2019.4.7f1\Editor\Data\il2cpp\libil2cpp" /I"C:\Program Files\Unity\Hub\Editor\2019.4.7f1\Editor\Data\il2cpp\libil2cpp" /I"C:\Program Files\Unity\Hub\Editor\2019.4.7f1\Editor\Data\il2cpp\external\bdwgc\include" /I"C:\Program Files\Unity\Hub\Editor\2019.4.7f1\Editor\Data\il2cpp\external\xxHash" /I"C:\Users\Creator\Desktop\sworkspace\Clients\Unity\commandos\Temp\StagingArea\Data\il2cppOutput" /I"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\winrt" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt" /Fo"C:\Users\Creator\Desktop\sworkspace\Clients\Unity\commandos\Library\UWP\x64\Release\il2cpp_cache\5733106FE2E503B2B149E5FD33BF4E7A.obj" /Fd"C:\Users\Creator\Desktop\sworkspace\Clients\Unity\commandos\Library\UWP\x64\Release\il2cpp_cache\5733106FE2E503B2B149E5FD33BF4E7A.pdb"
EnvArg key: PATH value: C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Windows Kits\10\bin\x86;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64

   at Unity.IL2CPP.Building.CppProgramBuilder.BuildAllCppFiles(IEnumerable`1 sourceFilesToCompile, IBuildStatisticsCollector statisticsCollector)
   at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
   at il2cpp.Program.DoRun(String[] args, List`1 foundAssemblies)
   at il2cpp.Program.Run(String[] args, Boolean setInvariantCulture)
   at il2cpp.Program.Main(String[] args)
stderr:

Unhandled Exception: Unity.IL2CPP.Building.BuilderFailedException: Il2CppTypeDefinitions.c
C:\Program Files\Unity\Hub\Editor\2019.4.7f1\Editor\Data\il2cpp\libil2cpp\il2cpp-config.h(3): fatal error C1083: Cannot open include file: 'assert.h': No such file or directory

Invocation was: Executable: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64\cl.exe"
Arguments: "C:\Users\Creator\Desktop\sworkspace\Clients\Unity\commandos\Temp\StagingArea\Data\il2cppOutput\Il2CppTypeDefinitions.c" /nologo /c /bigobj /W3 /Zi /EHs /GR- /Gy /utf-8 /wd4102 /wd4800 /wd4056 /wd4190 /wd4723 /wd4467 /wd4503 /wd4996 /wd4200 /Ox /Oi /Oy- /GS- /Gw /GF /Zo /MD /DNET_4_0 /DUNITY_AOT /DIL2CPP_MONO_DEBUGGER_DISABLED /DGC_NOT_DLL /DRUNTIME_IL2CPP /DIL2CPP_DEFAULT_DATA_DIR_PATH=Data/il2cpp_data /D_WIN32 /DWIN32 /DWIN32_THREADS /D_WINDOWS /DWINDOWS /D_UNICODE /DUNICODE /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS /D_WINSOCK_DEPRECATED_NO_WARNINGS /DNOMINMAX /D_NDEBUG /DNDEBUG /DWINDOWS_SDK_BUILD_VERSION=19041 /D__WRL_NO_DEFAULT_LIB__ /DWINAPI_FAMILY=WINAPI_FAMILY_APP /I"C:\Program Files\Unity\Hub\Editor\2019.4.7f1\Editor\Data\il2cpp\libil2cpp" /I"C:\Program Files\Unity\Hub\Editor\2019.4.7f1\Editor\Data\il2cpp\libil2cpp" /I"C:\Program Files\Unity\Hub\Editor\2019.4.7f1\Editor\Data\il2cpp\external\bdwgc\include" /I"C:\Program Files\Unity\Hub\Editor\2019.4.7f1\Editor\Data\il2cpp\external\xxHash" /I"C:\Users\Creator\Desktop\sworkspace\Clients\Unity\commandos\Temp\StagingArea\Data\il2cppOutput" /I"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\winrt" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt" /Fo"C:\Users\Creator\Desktop\sworkspace\Clients\Unity\commandos\Library\UWP\x64\Release\il2cpp_cache\5733106FE2E503B2B149E5FD33BF4E7A.obj" /Fd"C:\Users\Creator\Desktop\sworkspace\Clients\Unity\commandos\Library\UWP\x64\Release\il2cpp_cache\5733106FE2E503B2B149E5FD33BF4E7A.pdb"
EnvArg key: PATH value: C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Windows Kits\10\bin\x86;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64

   at Unity.IL2CPP.Building.CppProgramBuilder.BuildAllCppFiles(IEnumerable`1 sourceFilesToCompile, IBuildStatisticsCollector statisticsCollector)
   at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
   at il2cpp.Program.DoRun(String[] args, List`1 foundAssemblies)
   at il2cpp.Program.Run(String[] args, Boolean setInvariantCulture)
   at il2cpp.Program.Main(String[] args)

UnityEngine.Debug:LogError(Object)
UnityEditorInternal.Runner:RunProgram(Program, String, String, String, CompilerOutputParserBase)
UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase, Action`1)
UnityEditorInternal.IL2CPPBuilder:RunIl2CppWithArguments(List`1, Action`1, String)
UnityEditorInternal.IL2CPPBuilder:ConvertPlayerDlltoCpp(Il2CppBuildPipelineData, String, String, Boolean)
UnityEditorInternal.IL2CPPBuilder:Run()
UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry)
PostProcessWinRT:RunIL2CPPForExecutableBuild() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1924)
PostProcessWinRT:RunIL2CPP() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1849)
PostProcessWinRT:Process() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:214)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Exception: C:\Program Files\Unity\Hub\Editor\2019.4.7f1\Editor\Data\il2cpp/build/deploy/net471/il2cpp.exe did not run properly!
UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at <6776482ad98c481c9322bc7e45bcbc33>:0)
UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) (at <6776482ad98c481c9322bc7e45bcbc33>:0)
UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List`1[T] arguments, System.Action`1[T] setupStartInfo, System.String workingDirectory) (at <6776482ad98c481c9322bc7e45bcbc33>:0)
UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (UnityEditor.Il2Cpp.Il2CppBuildPipelineData data, System.String outputDirectory, System.String workingDirectory, System.Boolean platformSupportsManagedDebugging) (at <6776482ad98c481c9322bc7e45bcbc33>:0)
UnityEditorInternal.IL2CPPBuilder.Run () (at <6776482ad98c481c9322bc7e45bcbc33>:0)
UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at <6776482ad98c481c9322bc7e45bcbc33>:0)
PostProcessWinRT.RunIL2CPPForExecutableBuild () (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1924)
PostProcessWinRT.RunIL2CPP () (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1849)
PostProcessWinRT.Process () (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:214)
UnityEditor.UWP.BuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ExtensionModule.cs:85)
Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
UnityEditor.UWP.BuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ExtensionModule.cs:89)
UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <6776482ad98c481c9322bc7e45bcbc33>:0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <6776482ad98c481c9322bc7e45bcbc33>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

And I’ve already checked that assert.h is located at: C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt

Interesting! Can you confirm if that file is in “C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt” too? It seems IL2CPP is looking for it in there.

Hi, sorry for the late answer. No the file is not there and I don’t have verison 10.0.19041.0 installed on my machine at all.

Did you ever have that SDK installed? Unity takes this version from the registry…

Can you tell me what is HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v10.0\ProductVersion in the registry pointing that? If it’s 10.0.19041, can you try changing it to
10.0.18362.0 and see if it fixes the issue?

Yes, the registry entry was pointing to 10.0.19041, I’ve changed it to the correct version, but before that I deleted the whole Library folder from the projects main folder and let the Unity generated it again reimporting the projects and after that the project started to build and run successfully without any errors as D3D Project set in Build Settings. Even before changing the registry entry, so for now the Xbox build which was throwing the same error which @jskim05 reported is resolved!

Thanks for the help!

Another thing which I discovered after I had to redownload the project from git, it seems that I had some changes which weren’t pushed to the main git repo and I was having the same issue again, the project wasn’t building with the same error. After trying everything which I though I did before it turns out that the main reason for this error was that I have the symbol ’ in my game’s name which was causing the failing build.Once I removed it from the name everything started to work as it should be again!

Interesting, very nice! Do you have the number report number you submitted? I’ll add this additional info to it.

By the way, using “ExecutableOnly” build mode should make Build & Run operation faster. The only downside is that it doesn’t go through visual studio so you can’t submit those builds to the Windows Store.

I’ve tried more than 10 times to report that bug directly from Unity with a sample project but everytime it got stuck on 50% and was staying that way for an hour or so. The attached project was very small like 30-40MB so it’s not because the project was big one.

Damn, I’m sorry about that. I’m not exactly sure what could cause the bug reporter to misbehave like that.

Could you perhaps put the project on google drive/dropbox/onedrive or something similar and just include a link to it in your bug report?

P.S. Can you PM me your email you used for the bug submission? Our bug reporter devs would like to dig into logs of what happened.