MixedRealityToolkit-Unity
MixedRealityToolkit-Unity copied to clipboard
Can not build release arm for Hololens2
Describe the bug
I can build debug arm successfully. But can not build release arm.
To reproduce
I am using Unity2020.3.35 and Visual Studio 2022(x64) 17.2.4. I am using MR-WebRTC, so I have to build for Arm, not Arm64. I exported an empty MRTK scene(only clicked "add to to scene and configure..." in menu) in Unity and open it in Visual Studio. Then I try to run it to my Hololens2 with Debug Arm, and it is OK. But after I change to Release Arm, I got this error:
Unity.IL2CPP.Building.BuilderFailedException: mscorlib2.cpp Il2CppOutputProject E:\WorkSpace\Unity\MRTest\Build\UWP\Il2CppOutputProject\EXEC 1
Error C1001 �ڲ����������� Il2CppOutputProject E:\WorkSpace\Unity\MRTest\Build\UWP\Il2CppOutputProject\Source\il2cppOutput\mscorlib2.cpp 23662
Error MSB3073 命令“"E:\WorkSpace\Unity\MRTest\Build\UWP\Il2CppOutputProject\IL2CPP\build\deploy\netcoreapp3.1\il2cpp.exe" --libil2cpp-static --compile-cpp -architecture=ARMv7 -configuration=Release -platform=winrt -outputpath="E:\WorkSpace\Unity\MRTest\Build\UWP\build\bin\ARM\Release\GameAssembly.dll" --data-folder="E:\WorkSpace\Unity\MRTest\Build\UWP\build\bin\ARM\Release\" -cachedirectory="E:\WorkSpace\Unity\MRTest\Build\UWP\build\obj\il2cppOutputProject\ARM\Release\" -generatedcppdir="E:\WorkSpace\Unity\MRTest\Build\UWP\Il2CppOutputProject\Source" --incremental-g-c-time-slice=3 --baselib-directory="D:\Program Files\UnityEditors\2020.3.35f1c2\Editor\Data\PlaybackEngines\MetroSupport\Players\UAP\il2cpp\ARM\Release" --avoid-dynamic-library-copy --profiler-report --additional-defines=WINDOWS_UWP --additional-defines=UNITY_UWP --additional-defines=UNITY_WSA_10_0 --additional-defines=UNITY_WSA --additional-defines=UNITY_WINRT --additional-defines=PLATFORM_WINRT -dotnetprofile=unityaot -verbose --relative-data-path=Data/il2cpp_data --map-file-parser="E:\WorkSpace\Unity\MRTest\Build\UWP\Il2CppOutputProject\IL2CPP\MapFileParser\MapFileParser.exe"”已退出, code 4。 Il2CppOutputProject D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets 45
Error LNK1181 can not open input file “E:\WorkSpace\Unity\MRTest\Build\UWP\build\bin\ARM\Release\GameAssembly.lib” MRTest E:\WorkSpace\Unity\MRTest\Build\UWP\MRTest\LINK 1
Your setup (please complete the following information)
- Unity2020.3.35
- MRTK 2.8.0.0
- Visual Studio 2022(x64) 17.2.4
Target platform (please complete the following information)
- HoloLens 2
I'm experiencing the same problem while building Release version for ARM. I am also using MR-WebRTC and was trying to build Release for ARM with VS2019(16.11.15) and VS2022(17.2.4) but they both failed with the same error as above. Unity 2020.3.34, MRTK 2.7. With Debug mode it's working
We looked at upgrading the Unity Version to 2020.3.X from 2019.4.Y, but iirc we hit the wall of 2020.3.X must use the OpenXR plugin instead of the Windows Mixed reality (legacy one that is deprecated in 2019 and removed in 2020).
We still use the 2019.4.Y Unity version with MR-WebRTC and ARM build.
I think our conclusion was that OpenXR relied on 64 bit (ARM64) build to work, and WebRTC package only supporting the 32-bit build.
We never actually tried making a build with 2020 Unity OpenXR with MRTK and WebRTC.
I have no idea how the Debug could work but not release, just giving our input on this matter, maybe helps someone in the process of figuring this out!
Cheers,
I've upgraded my project with MR-WebRTC testwise from Unity 2019.4.X / Legacy XR to Unity 2020.3.X / OpenXR / MRTK 2.7.3 and it works for ARM (tested Release / Master) with VS 2019. This problem only occured when building with VS 2022 for ARM (Release / Master), even if MR-WebRTC is not included.
I did some more testing and figured out that I can build for Release/Master with VS2019 after I deleted VS2022 from my laptop. I have no idea why it was influencing building with VS2019, I checked that I was using proper platform toolset v142 (for VS2019). If you don't need VS2022 for other purposes you can try to uninstall it and check if you can build with VS2019
I've upgraded my project with MR-WebRTC testwise from Unity 2019.4.X / Legacy XR to Unity 2020.3.X / OpenXR / MRTK 2.7.3 and it works for ARM (tested Release / Master) with VS 2019. This problem only occured when building with VS 2022 for ARM (Release / Master), even if MR-WebRTC is not included.
Worked for me, Thank you! I need to uninstall VS2022 then I can build ARM release with VS2019.
I did some more testing and figured out that I can build for Release/Master with VS2019 after I deleted VS2022 from my laptop. I have no idea why it was influencing building with VS2019, I checked that I was using proper platform toolset v142 (for VS2019). If you don't need VS2022 for other purposes you can try to uninstall it and check if you can build with VS2019
Same, I uninstall VS2022 and then I build ARM release successfully with VS2019.
We appreciate your feedback and thank you for reporting this issue.
Microsoft Mixed Reality Toolkit version 2 (MRTK2) is currently in limited support. This means that Microsoft is only fixing high priority security issues. Unfortunately, this issue does not meet the necessary priority and will be closed. If you strongly feel that this issue deserves more attention, please open a new issue and explain why it is important.
Microsoft recommends that all new HoloLens 2 Unity applications use MRTK3 instead of MRTK2.
Please note that MRTK3 was released in August 2023. It features an all new architecture for developing rich mixed reality experiences and has a minimum requirement of Unity 2021.3 LTS. For more information about MRTK3, please visithttps://www.mixedrealitytoolkit.org.
Thank you for your continued support of the Mixed Reality Toolkit!