Search Issue Tracker

Fixed in 2020.2.X

Fixed in 2019.4.X, 2020.1.X



Found in







Issue ID




[UWP] Building multi-platform .appxbundle via MSBuild fails with IL2CPP scripting backend

How to reproduce:
1. Create a new empty project
2. Switch Target platform to UWP
3. Set 'Scripting Backend' to IL2CPP
4. Build the project
5. Open the PowerShell in the Build directory
6. Execute the following commands:
1. $msbuild='C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe'
2. & $msbuild .\<PROJECT-NAME>.sln /t:"restore,build" /p:"AppxBundle=Always;AppxBundlePlatforms=x86|ARM" /p:Configuration=Master > build.txt 2>&1

Expected result: "0" is printed out (meaning that the building was successful)
Actual result: "1" is printed out (meaning that the building failed)

Reproducible with - 2017.4.0f1, 2017.4.29f1, 2018.4.3f1, 2019.1.8f1, 2019.2.0b8, 2019.3.0a8


This is caused by a "feature" in MSBuild were the output directory is nested when performing a multi-platform build. This functionality must be explicitly disabled to build the Unity generated project. The issue is discussed on these MS developer sites:

To work around this issue pass: "/p:UseSubFolderForOutputDirDuringMultiPlatformBuild=false" on the MSBuild command line.
For example:

& $msbuild .\<PROJECT-NAME>.sln /t:"restore,build" /p:"AppxBundle=Always;AppxBundlePlatforms=x86|ARM" /p:Configuration=Master /p:UseSubFolderForOutputDirDuringMultiPlatformBuild=false > build.txt 2>&1

  1. Resolution Note (fix version 2020.2):

    Adds <UseSubFolderForOutputDirDuringMultiPlatformBuild>false</UseSubFolderForOutputDirDuringMultiPlatformBuild> to the Unity generated Visual Studio project.

  2. Resolution Note (fix version 2020.1):

    Fixed in: 2020.1.4f1

  3. Resolution Note (fix version 2019.4):

    Fixed in: 2019.4.10f1

Comments (1)

  1. camogram

    Mar 13, 2020 04:14

    Some notes from my testing: (2018.4.18f1):

    1: Platform="x86";AppxBundlePlatforms="x86";Configuration=Master;AppxBundle=Always;
    2: Platform="ARM";AppxBundlePlatforms="ARM";Configuration=Master;AppxBundle=Always;
    3: Platform="x86|ARM";AppxBundlePlatforms="x86|ARM";Configuration=Master;AppxBundle=Always;
    4: AppxBundlePlatforms="x86|ARM";Configuration=Master;AppxBundle=Always;
    5: AppxBundlePlatforms="x86";Configuration=Master;AppxBundle=Always;

    1 & 2 Build OK (but only for one platform).
    3 is an invalid configuration (Only one platform can be specified)
    4 (OP) Attempts to build the x86 project to ARM folders - strange. Fails before attempting 'actual' ARM project.
    5 Same result as in 4.

    I have not tested changing the 'Architecture' output between x86 and ARM in the Unity GUI - though I presume this would result in the same (reverse) error.

    A cursory glance suggests this is an msbuild limitation as much as a unity one.


Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.