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

Unable to build for UWP

Discussion in 'Burst' started by creat327, Apr 7, 2022.

  1. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,739
    Hi

    Everything was working fine until I decided to upgrade to 2021.2.19f from 2021.2.18f Now, every time I try to build my project for UWP, I get this error. Any ideas what's going on? Using Unity 2021.2.19f here


    BuildFailedException: Burst compiler (1.6.5) failed running
    stdout:
    Unexpected exception while collecting types in assembly `System.Runtime.WindowsRuntime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089`
    stderr:
    Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Windows.Foundation, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null'
    at Mono.Cecil.BaseAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters)
    at zzzUnity.Burst.CodeGen.AssemblyLoader.Resolve(AssemblyNameReference name)
    at Mono.Cecil.MetadataResolver.Resolve(TypeReference type)
    at Mono.Cecil.TypeReference.Resolve()
    at Burst.Bcl.BclApp.CollectGenericTypeInstances(TypeReference type, List`1 types, HashSet`1 visited)
    at Burst.Bcl.BclApp.CollectGenericTypeInstances(AssemblyDefinition assembly, List`1 types, HashSet`1 visited)
    at Burst.Bcl.BclApp.FindExecuteMethods(List`1 rootAssemblyPaths, Boolean includeRootAssemblyReferences)
    Unity.Burst.Editor.BurstAotCompiler+BclRunner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at Library/PackageCache/com.unity.burst@1.6.5/Editor/BurstAotCompiler.cs:1447)
    Unity.Burst.Editor.BurstAotCompiler+BclRunner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at Library/PackageCache/com.unity.burst@1.6.5/Editor/BurstAotCompiler.cs:1313)
    Unity.Burst.Editor.BurstAotCompiler+BclRunner.RunManagedProgram (System.String exe, System.String args, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at Library/PackageCache/com.unity.burst@1.6.5/Editor/BurstAotCompiler.cs:1288)
    Unity.Burst.Editor.BurstAotCompiler.OnPostBuildPlayerScriptDLLsImpl (UnityEditor.Build.Reporting.BuildReport report) (at Library/PackageCache/com.unity.burst@1.6.5/Editor/BurstAotCompiler.cs:548)
    Unity.Burst.Editor.BurstAotCompiler.OnPostBuildPlayerScriptDLLs (UnityEditor.Build.Reporting.BuildReport report) (at Library/PackageCache/com.unity.burst@1.6.5/Editor/BurstAotCompiler.cs:208)
    UnityEditor.Build.BuildPipelineInterfaces.OnPostBuildPlayerScriptDLLs (UnityEditor.Build.Reporting.BuildReport report) (at <780782bc035845f9909cebbd4c983ae3>:0)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)



    There is also a warning right before this, and I check and the test framework is installed.


    Unable to find player assembly: D:\Dropbox\DogfightUnity5URP\Temp\StagingArea\Data\Managed\UnityEngine.TestRunner.dll
    UnityEngine.Debug:LogWarning (object)
    Unity.Burst.Editor.BurstAotCompiler:OnPostBuildPlayerScriptDLLsImpl (UnityEditor.Build.Reporting.BuildReport) (at Library/PackageCache/com.unity.burst@1.6.5/Editor/BurstAotCompiler.cs:350)
    Unity.Burst.Editor.BurstAotCompiler:OnPostBuildPlayerScriptDLLs (UnityEditor.Build.Reporting.BuildReport) (at Library/PackageCache/com.unity.burst@1.6.5/Editor/BurstAotCompiler.cs:208)
    UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
     
    Last edited: Apr 8, 2022
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,504
    Hey can you report a bug on this? Not sure what is going on, will have to dig in.
     
  3. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,739
    My project is SUPER large and I have no clue which file is provoking this... how do i go about this?
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,504
    It's going to be in scripts and/or plugins/DLLs. You could try copying just those files to another Unity project and building an empty scene to see if it reproduces.
     
  5. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,739
    ok, after spending 8 hours removing folder by folder... and then ending up with a project with zero scripts, no assets whatsoever and still failing... so the only thing remaining were the Unity packages. (what a surprise)

    Results: the Unity in-app purchase package. Import the latest one which is 4.1.3, and your UWP project won't build with this error in Unity 2021.2.19f using URP. Awesome. Now I'm stuck again without being able to release.

    So I spent some time trying to figure out what has changed. The in-app package for 4.1.3 hasn't changed in months, so it had to be the burst compiler. Not saying in-app package is not at fault, but it was compiling with 2021.2.18.

    So I rolled back the Burst package to 1.6.4 and voila! Fixed. Burst 1.6.5 and 1.7.0 will fail to compile the Unity in-app package for UWP. You need to roll back to 1.6.4 which is included with Unity 2021.2.18

    I've reported this as Case 1418361
     
    Last edited: Apr 8, 2022
    george_wyy and lukasz13 like this.
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,504
    I'm glad you found a workaround, and sorry for the breakage. Thanks for the bug report, we'll investigate & fix it.
     
  7. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,739
    Btw you should provide an easy way for us to roll back packages. Not everyone knows that you can edit the package manifest manually and delete it from the library folder so that it downloads the wanted version. Providing a history of the different package versions on the package manager would be helpful for us, at least during beta/alpha so that we can roll back and test.

    It would also help us see what packages were updated on each Unity version without having to go through the release notes. In this case, the bug was introduced by jumping from stable Unity 2021.2.18 to 2021.2.19, not because of the editor itself but because the package manager updated the Burst package to 1.6.5 from 1.6.4 automatically. I wouldn't expect a minor stable release to break the project.
     
  8. Mr-Buck

    Mr-Buck

    Joined:
    Nov 3, 2015
    Posts:
    21
    Hi creat327

    I'm exactly the one that you mention who doesn't know how to downgrade Burst packages.

    I found that in Unity 2021.3.0 LTS, you have to use Burst 1.6.5. It is locked at MyProjectRoot/Packages/packages-lock.json

    I try the way you said and delete Library folder and still can't downgrade Burst.

    could you explain more specifically on how to get Burst 1.6.4?
     
  9. StarCoop

    StarCoop

    Joined:
    Nov 26, 2016
    Posts:
    44
    Aaaaaaand another wonderful day in the adventure bay of Unity.

    Two days before project milestone release for a customer, the HoloLens build simply HAS to work.
    Unity 2021.2.8:
    Builds, but Visual Studio compiler is always stuck at some point without error or anything.

    Upgrade Unity to new 2021.1.3 LTS:
    Spend a full day figuring out what the hell is missing, upgrading/deleting/installing packages, dlls, folders, whatever and not. Opening a bazillion tabs on chrome.
    Now thankfully, I found this thread... It turns out, Burst compiler is doing nonsense, since two versions, and latest reply from Unity is 11 freaking days old.
    E.le.ven.
    For a critical issue where the LTS cannot be used to build projects with IL2CPP (which is -required- for HoloLens 2).

    I cannot emphasize this enough, I'm sick of this kind of quality management. That is the opposite of what a "LTS" version is for, the absolute and utmost opposite. This cost my company a working day, and myself a ton of nerves. My customer is Mercedes Benz by the way, and this is the kind of quality Unity can deliver to this kind industry...
    But thankfully we have new 2D mobile game features, who needs IL2CPP anyway.

    @Mr-Buck:

    packages-lock.json:
    "com.unity.burst": {
    "version": "1.6.4",
    <- change to desired version
    "depth": 0,
    "source": "registry",
    "dependencies": {
    "com.unity.mathematics": "1.2.1"
    },
    "url": "https://packages.unity.com"
    },

    packages-json:
    "com.unity.burst": "1.6.4",
    <- add this line so the default version (1.6.5 in our case) doesn't get fetched)

    And delete the folder:
    \Library\PackageCache\com.unity.burst@1.6.5
    so the desired version actually gets downloaded.


    edit:
    The problem is the same as has been in the recent years: You're not actually using your own product. You've started to walk this route, and I acknoledge that, but with a team of 15 people (as far as I've read) creating a 3D game.
    There is probably no one delivering or at least testing an industry app on HoloLens 2 before releasing a new Unity version (in other words testing a new Burst compiler version for issues on IL2CPP-only devices). This dooms us end-users to be your function testers forever, and I don't like that. Upgrading Unity is and has always been an unwanted adventure, and one that could be solved, but isn't.
     
    Last edited: Apr 19, 2022
    Andz4R and lukasz13 like this.
  10. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,739
    I feel your pain. And I seriously doubt anyone at Unity test much before release. There are some versions of Unity that would not even compile a basic project on different platforms. Like this one for instance, you just needed to have a project with in-app purchases (basic enough) for it to not compile in UWP. Or the other reported bug, where platform defines are completely ignored for anything other than standalone... and so on. I mean, you just need a real life project to build and check and some of the LTS, beta and alpha would not even see the light.

    I'm glad I was able to help with the solution. I also lost a full day on this one until I found the issue.
     
  11. Mr-Buck

    Mr-Buck

    Joined:
    Nov 3, 2015
    Posts:
    21
    Hi @StarCoop and @creat327

    I also find a workaround for how to downgrade Brust.

    1. remove Netcode 1.0.0-pre.7 ( because Brust depend on it)

    2. delete folder Library/BrustCache and remove brust from package-lock.json

    3.add "com.unity.burst": "1.6.4" line in Packages/manifest.json.

    4.add older version of Netcode ( 1.0.0-pre.5 )


    In my Multiplayer MR project , I failed to build because under Unity 2021, if you don't specify the version of your Netcode, you will download 1.0.0-pre.7 by default, which will automatically add Brust 1.6.5. With Brust 1.6.5 installed, you will get that same error when you build the project.

    But this solution is still with some risk, I once try to upgrade to Burst 1.7.0, It still failed with the same error, which means that they might not gonna fix it in the future version of Burst? I just know that if my project require feature from newer version of Brust or Netcode. I'll have to find another solution then...
     
    Andz4R likes this.
  12. Mr_Reag

    Mr_Reag

    Joined:
    Nov 30, 2017
    Posts:
    1
    I have also been affected by this issue. Im the lead developer for my company building drone control software for the HoloLens, and our move to upgrade Unity versions really caused us issues. @StarCoop thanks for posting a fix for this issue.

    Im really disappointed by this problem. The inability to compile to an entire platform is a serious issue that should have been caught in the automatic build tests
     
  13. JasonSmithCGI

    JasonSmithCGI

    Joined:
    Sep 14, 2017
    Posts:
    2
    Thank goodness for this thread. Saved me a lot of time and headaches.
     
  14. azimmerman

    azimmerman

    Joined:
    Mar 10, 2020
    Posts:
    9
    I seem to be experiencing the same issue. Where can I see Case 1418361? @Tautvydas-Zilys , would you please provide an update?
     
  15. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,504
  16. ickydime

    ickydime

    Joined:
    Nov 20, 2012
    Posts:
    110
    Updating burst creates new issues. At least 1.7.1 is unable to compile on UWP. Stick with 1.6.4
     
  17. lukasz13

    lukasz13

    Joined:
    Jul 10, 2017
    Posts:
    7
    sheredom likes this.