MicrosoftEdge / WebView2Samples

Microsoft Edge WebView2 samples
830 stars 460 forks source link

Unity Sample Project immediately crashes once deployed to the HoloLens2/ in the Emulator #229

Open bensubytes opened 6 months ago

bensubytes commented 6 months ago

I have cloned the repository with the HoloLens WebView Example and it works perfectly fine in Unity. Once I open the project on the HoloLens2 it crashes after opening it. The HoloLens uses 22621.1252 as the OS, which to my understanding is Windows 11.

I build it with my usual settings which are:

Unity version: 2021.3.24f Architecture: ARM 64Bit Build Type: D3D Project Target SDK: Latest installed Min. Platform Version: 10.0.18362.0 Visual Studio Version: Lates installed Build and run on: Local machine Build Config: Release

The build succeeds pretty quickly. After that I opened the solution in VS 2019, the latest version. I select Release, ARM64, Device and Start without Debugging.

Usually this should work perfectly fine, but I run into several issues, and can't find information to fix it that actually works. The main error was not having v143 build tools installed, but it was impossible to install them.

That's why I used VS2022 to deploy the project and it was successful.

When I opened the WebView on the HoloLens for the first time, it was open for around a minute, but the WebView was blank, and it crashed.

Now it just keeps crashing immediately.

Has anyone run into this issue?

I have tried deploying it to the HoloLens Simulator and there it crashes with a lot of errors, some of them look like this: `Exception thrown at 0x00007FF9116AEF5C in WebView2HoloLensSample.exe: Microsoft C++ exception: winrt::hresult_error at memory location 0x000000B22C7FF260. The program '[2360] WebView2HoloLensSample.exe' has exited with code 4294967295 (0xffffffff).

WebView2: Failed to find an installed WebView2 runtime or non-stable Microsoft Edge installation. Exception thrown at 0x00007FF9116AEF5C (KernelBase.dll) in WebView2HoloLensSample.exe: WinRT originate error - 0x80070002 : 'The system cannot find the file specified.'. onecore\com\combase\winrt\error\restrictederror.cpp(966)\combase.dll!00007FF911B9EC73: (caller: 00007FF911A78A51) LogHr(1) tid(6f4) 80070490 Element not found. onecore\com\combase\winrt\error\restrictederror.cpp(966)\combase.dll!00007FF911B9EC73: (caller: 00007FF911A78A51) LogHr(2) tid(6f4) 80070490 Element not found. onecore\com\combase\winrt\error\restrictederror.cpp(966)\combase.dll!00007FF911B9EC73: (caller: 00007FF911A78A51) LogHr(3) tid(6f4) 80070490 Element not found. onecore\com\combase\winrt\error\restrictederror.cpp(966)\combase.dll!00007FF911B9EC73: (caller: 00007FF911A78A51) LogHr(4) tid(6f4) 80070490 Element not found. onecore\com\combase\winrt\error\restrictederror.cpp(966)\combase.dll!00007FF911B9EC73: (caller: 00007FF911A78A51) LogHr(5) tid(6f4) 80070490 Element not found. onecore\com\combase\winrt\error\restrictederror.cpp(966)\combase.dll!00007FF911B9EC73: (caller: 00007FF911A78A51) LogHr(6) tid(6f4) 80070490 Element not found. onecore\com\combase\winrt\error\restrictederror.cpp(966)\combase.dll!00007FF911B9EC73: (caller: 00007FF911A78A51) LogHr(7) tid(6f4) 80070490 Element not found.`

I have also uploaded the Log Files from the HoloLens here: https://drive.google.com/file/d/19dCxN6YRQQUZHGu3dwrIRH_ttMAnMNGD/view

Since they don't give a clear error, it was suggested to me to open up an issue here.