Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug UWP build crashing

Discussion in 'Editor & General Support' started by RafalJaroszewiczSH, Jun 29, 2023.

  1. RafalJaroszewiczSH

    RafalJaroszewiczSH

    Joined:
    Dec 18, 2020
    Posts:
    7
    Hi, i recently migrated my project from unity 2020 to 2022.3.3f. And the problem with UWP build appeared, earlier it was working fine. But after change the build is returning errors from IL2CPP:
    Code (CSharp):
    1. C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VisualStudio\v17.0\AppxPackage\Microsoft.AppXPackage.Targets(3042,5): error APPX0702: Payload file 'C:\xxx\Il2CppOutputProject\Source\il2cppOutput\Symbols\il2cppFileRoot.txt' does not exist.
    2. C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VisualStudio\v17.0\AppxPackage\Microsoft.AppXPackage.Targets(3042,5): error APPX0702: Payload file 'C:\xxx\Il2CppOutputProject\Source\il2cppOutput\Symbols\LineNumberMappings.json' does not exist.
    I added the "--emit-source-mapping" to additionalIl2CppArgs in ProjectSettings, but it have no effect. Did anyone had this problem?
     
    Last edited: Jun 29, 2023
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,627
    That error is not from IL2CPP. Do you get these when pressing build & run in the editor? Or when building from Visual Studio? If it's the former, can you attach your Unity log? If it's the latter, can you switch to the "Output" window and show its full contents?
     
  3. RafalJaroszewiczSH

    RafalJaroszewiczSH

    Joined:
    Dec 18, 2020
    Posts:
    7
    Thank you for response. This happening when i run visual studio build.

    Code (CSharp):
    1. Build started...
    2. 1>------ Build started: Project: Il2CppOutputProject, Configuration: Master ARM64 ------
    3. 1>C:\holo_build\Il2CppOutputProject\IL2CPP\build\deploy\il2cpp.exe --compile-cpp --platform=WinRT --relative-data-path=Data/il2cpp_data --dotnetprofile=unityaot-win32 --profiler-report --print-command-line --architecture=ARM64 --configuration=Release --outputpath=C:\holo_build\\build\bin\ARM64\Master\GameAssembly.dll --data-folder=C:\holo_build\\build\bin\ARM64\Master\ --cachedirectory=C:\holo_build\\build\obj\il2cppOutputProject\ARM64\Master\ --generatedcppdir=C:\holo_build\Il2CppOutputProject\\Source --verbose --baselib-directory=C:\holo_build\Players\UAP\il2cpp\ARM64\Master --profiler-output-file=C:\holo_build\\build\obj\il2cppOutputProject\ARM64\Master\profile.json --compiler-flags=-d2ssa-cfg-jt-
    4. 1>Starting: C:\holo_build\Il2CppOutputProject\IL2CPP\build\deploy\bee_backend\win-x64\bee_backend.exe --profile="C:/holo_build/build/obj/il2cppOutputProject/ARM64/Master/buildstate/backend_profiler0.traceevents" --beedriver-listener --dagfile="C:/holo_build/build/obj/il2cppOutputProject/ARM64/Master/buildstate/bee.dag" --continue-on-failure FinalProgram
    5. 1>WorkingDir: C:/holo_build/build/obj/il2cppOutputProject/ARM64/Master/buildstate
    6. 1>ExitCode: 4 Duration: 0s212ms
    7. 1>ExitCode: 0 Duration: 0s1ms
    8. 1>Starting: C:\holo_build\Il2CppOutputProject\IL2CPP\build\deploy\bee_backend\win-x64\bee_backend.exe --profile="C:/holo_build/build/obj/il2cppOutputProject/ARM64/Master/buildstate/backend_profiler1.traceevents" --beedriver-listener --dagfile="C:/holo_build/build/obj/il2cppOutputProject/ARM64/Master/buildstate/bee.dag" --continue-on-failure --dagfilejson="C:/holo_build/build/obj/il2cppOutputProject/ARM64/Master/buildstate/bee.dag.json" FinalProgram
    9. 1>WorkingDir: C:/holo_build/build/obj/il2cppOutputProject/ARM64/Master/buildstate
    10. 1>ExitCode: 0 Duration: 16m:35s
    11. 1>Build succeeded with 1373 successful nodes and 0 failed ones
    12. 1>
    13. 2>------ Build started: Project: HoloApp, Configuration: Master ARM64 ------
    14. 2>pch.cpp
    15. 2>App.cpp
    16. 2>Main.cpp
    17. 2>UnityGenerated.cpp
    18. 2>   Creating library C:\holo_build\build\bin\ARM64\Master\HoloApp.lib and object C:\holo_build\build\bin\ARM64\Master\HoloApp.exp
    19. 2>Generating code
    20. 2>Finished generating code
    21. 2>HoloApp.vcxproj -> C:\holo_build\build\bin\ARM64\Master\HoloApp.exe
    22. 2>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VisualStudio\v17.0\AppxPackage\Microsoft.AppXPackage.Targets(3042,5): error APPX0702: Payload file 'C:\holo_build\Il2CppOutputProject\Source\il2cppOutput\Symbols\il2cppFileRoot.txt' does not exist.
    23. 2>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VisualStudio\v17.0\AppxPackage\Microsoft.AppXPackage.Targets(3042,5): error APPX0702: Payload file 'C:\holo_build\Il2CppOutputProject\Source\il2cppOutput\Symbols\LineNumberMappings.json' does not exist.
    24. 2>Done building project "HoloApp.vcxproj" -- FAILED.
    25. ========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    26. ========== Build started at 11:26 AM and took 17:02.436 minutes ==========
    27. ========== Package: 0 succeeded, 1 failed ===========
    28.  
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,627
    That is very weird. Can you share the "Unity Data.vcxproj" and "HoloApp.vcxproj" files that Unity generated for you? Do you have any plugins that might be modifying these?
     
  5. RafalJaroszewiczSH

    RafalJaroszewiczSH

    Joined:
    Dec 18, 2020
    Posts:
    7
    Hi sory for delay, and thank you for your interest in helping me. There are the files:
     

    Attached Files:

  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,627
    Can you try removing --emit-source-mapping from those additional arguments? I'm not sure why you added that but it should fix it. If that doesn't work, let me know.

    You could also temporarily work around it by editing "Unity Data.vcxproj" with a text editor and remove references to those two non-existing files. But those changes will be lost once you rebuild the project from the editor.
     
  7. RafalJaroszewiczSH

    RafalJaroszewiczSH

    Joined:
    Dec 18, 2020
    Posts:
    7
    I added --emit-source-mapping in attempt to solve this issue.
     
  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,627
    Does removing it and rebuilding the project as a clean build to an empty folder fix it?
     
  9. RafalJaroszewiczSH

    RafalJaroszewiczSH

    Joined:
    Dec 18, 2020
    Posts:
    7
    Nope, it did not help. I have tried in fresh clean build folder.
     
  10. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,627
    I know this is less than ideal, but can you file a bug report? I am out of troubleshooting ideas.
     
  11. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,627
    Do you have a bug report number? I'm not sure where this ended up in.
     
  12. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    I help find bugs. I see them all the time. Like this one
    Bug - Android text from editor to device in wrong position. - Unity Forum

    Someone else can do the bug report who is getting paid. Once they unban me from posting reviews on the asset store, i will start doing reports again. It's been like 7 years since they banned me for posting a few lines of code that had back doors from the publisher. i found them and alerted people. They banned me and the guy still has his asset on the store. Once you right a wrong, then i will start again.
     
  13. LinnPeder

    LinnPeder

    Joined:
    Jul 6, 2022
    Posts:
    3
    I have the same issue with the folder Symbols and the two mentioned files, that ends up in the wrong place.
    upload_2023-8-10_12-59-38.png
    This happens only for this Unity project and not other but I don't know what the difference is between the two projects.

    Also, when trying to build directly to UWP hardware (HoloLens 2), there are no errors in Unity (see console output below) but it is not deployed! I am pressing Build and Run, which have worked previously to the issue I mention above.
    upload_2023-8-10_12-57-5.png

    - Unity 2022.3.2f1
    - Visual Studio 17.6.5


    UPDATE:
    Just tested the project where I did not have this issue before. I now have it in that project as well. I haven't changed a thing.
     

    Attached Files:

    Last edited: Aug 10, 2023
  14. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,627
    Can you submit a bug report and attach the project that reproduces it? You can delete any non-code assets and scenes from it to make it smaller, I think that shouldn't affect the reproduction.

    We currently suspect that some project settings are getting corrupt, as we couldn't reproduce this in our own testing. So we are hoping to be able to identify what goes wrong if we get our hands on a project that makes this happen.
     
    LinnPeder likes this.
  15. holo-krzysztof

    holo-krzysztof

    Joined:
    Apr 5, 2017
    Posts:
    77
    I'm also hitting this in a project that has been upgraded over the years (started on 2019.4, gone through 2020, 2021 and now on 2022 LTS).

    At first I thought it might have been related to XR settings because they've changed over the years (and Unity data migration for ScriptableObjects has been wonky over the years in my experience), but recreating them from scratch didn't change a thing.

    I noticed that those files (il2cppFileRoot.txt and the other one) show up in the bee artifact files. Would those files help you diagnose the issue?
     
  16. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,627
    Yes! We still haven't been able to reproduce this.
     
    holo-krzysztof likes this.
  17. AJJAlliander

    AJJAlliander

    Joined:
    Jun 27, 2022
    Posts:
    3
    I experienced this same issue after upgrading a project from 2021 to 2022. Initially I was able to resolve the issue by removing my project settings and have them regenerated and setting the options again manually. However, since then Unity Cloud Diagnostics stopped working for the project. When investigating the settings I found out the service package was missing. After installing it and activating the service again the build error was back. This indicated that, in my case at least, the issue is caused by the inclusion of the Unity Cloud Diagnostics service to the project. This lead me to trying to find steps to reproduce this issue consistently. Here are my findings:

    • In Unity 2022.3.12f1 create a new project using the 3D project template.
    • I selected Unity Cloud to activated and selected my organization but I assume you could also activated after the project was created and opened in Unity.
    • Once the project opened I switched to Universal Windows Platform with the following settings:
      • Architecture: ARM 64-bit
      • Build Type: D3D Project
      • Target SDK Version: Latest installed
      • Minimum Platform Version: 10.0.18362.0
      • Visual Studio Version: Visual Studio 2022
      • Build and Run on: Remote Device (via Device Portal)
      • Build configuration: Release
    • I added the SampleScene to Scenes In Build
    • I then hit Build And Run and the test project builds and deploys to the HoloLens succesfully
    • I then opened Window -> General -> Services and installed the Cloud Diagnostics 1.0.6 package
    • Opened the Cloud Diagnostics configuration in the Project Settings and activated the service with the big toggle switch.
    • I then hit Build And Run and the build fails when building the Visual Studio project with the error that il2cppFileRoot.txt and LineNumberMappings.json files do not exist.

    I hope this helps in finding the root cause of the issue and that we can expect a fix in a Unity or Cloud Diagnostics package update soon.

    In the meantime I will be using LocalJoost's nice PostProcessBuild script:
    Fixing HoloLens 2 app build failure indicating il2cppFileRoot.txt and LineNumberMappings.json do not exist - DotNetByExample - The Next Generation (localjoost.github.io)
     
    PeachyPixels likes this.
  18. holo-krzysztof

    holo-krzysztof

    Joined:
    Apr 5, 2017
    Posts:
    77
    I've sent you the file via private message.
     
    PeachyPixels likes this.
  19. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,627
  20. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    703
    I've just encountered this, after not building UWP for quite a while.

    The proposed workaround by @Tautvydas-Zilys worked for me. Thank you! I note the bug report and am wondering if it's any closer to being fixed in 2022.LTS?

    Has anyone tried this in Unity Build Automation? I'm about to setup a UWP build in UBA, but don't want to waste minutes or time (chasing refunds) for Unity bugs.
     
  21. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    703
    FYI

    Just tested the UWP build on UBA and it also fails. So we're back to manual\local UWP builds unfortunately.
     
  22. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,627
    Yes, we are making progress. Once it's verified fixed in 2023.3 beta, it will be backported to older supported releases such as 2022 LTS.
     
    PeachyPixels likes this.