microsoft / MixedReality-SpectatorView

Mixed reality spectator experiences
MIT License
194 stars 114 forks source link

QR and ArUco script reference issues in PR #375 [Microsoft.Windows.ApplicationModel, Microsoft.Windows.System] #380

Open Naphier opened 4 years ago

Naphier commented 4 years ago

Environment info: Unity 2019.3.7f1 MixedReality-SpectatorView at PR #375 (i.e. v1.2.0) MRTK 2.3.0 Windows SDK

Since I could not build due to a wide variety of issues in master I'm trying to use PR #375 When attempting to build UWP platform the below errors block building:

MixedReality-SpectatorView\packages\com.microsoft.mixedreality.spectatorview.1.2.0\SpectatorView\Scripts\SpatialAlignment\MarkerVisual\QRCodeMarkerVisualDetectorSpatialLocalizer.cs(20,25): error CS0234: The type or namespace name 'Package' does not exist in the namespace 'Microsoft.Windows.ApplicationModel' (are you missing an assembly reference?)

MixedReality-SpectatorView\packages\com.microsoft.mixedreality.spectatorview.1.2.0\SpectatorView\Scripts\SpatialAlignment\MarkerVisual\QRCodeMarkerVisualDetectorSpatialLocalizer.cs(20,85): error CS0234: The type or namespace name 'ProcessorArchitecture' does not exist in the namespace 'Microsoft.Windows.System' (are you missing an assembly reference?)

MixedReality-SpectatorView\packages\com.microsoft.mixedreality.spectatorview.1.2.0\SpectatorView\Scripts\SpatialAlignment\PhysicalMarker\ArUcoThreeMarkerSpatialLocalizer.cs(32,24): error CS0234: The type or namespace name 'Package' does not exist in the namespace 'Microsoft.Windows.ApplicationModel' (are you missing an assembly reference?)

MixedReality-SpectatorView\packages\com.microsoft.mixedreality.spectatorview.1.2.0\SpectatorView\Scripts\SpatialAlignment\PhysicalMarker\ArUcoThreeMarkerSpatialLocalizer.cs(32,84): error CS0234: The type or namespace name 'ProcessorArchitecture' does not exist in the namespace 'Microsoft.Windows.System' (are you missing an assembly reference?)

MixedReality-SpectatorView\packages\com.microsoft.mixedreality.spectatorview.1.2.0\SpectatorView\Scripts\SpatialAlignment\PhysicalMarker\QRCodeMarkerDetectorSpatialLocalizer.cs(28,25): error CS0234: The type or namespace name 'Package' does not exist in the namespace 'Microsoft.Windows.ApplicationModel' (are you missing an assembly reference?)

MixedReality-SpectatorView\packages\com.microsoft.mixedreality.spectatorview.1.2.0\SpectatorView\Scripts\SpatialAlignment\PhysicalMarker\QRCodeMarkerDetectorSpatialLocalizer.cs(28,85): error CS0234: The type or namespace name 'ProcessorArchitecture' does not exist in the namespace 'Microsoft.Windows.System' (are you missing an assembly reference?)

Build of this project (via CreateUnityPackage.bat) seems to run fine (only with HardCopySymbolicLinks on). See attached log for output of that.

CreateUnityPackage_output.txt

As a quick workaround (since I don't plan to use ArUco or QR) I simply commented out the relevant lines with return false. Although that allows Unity to build out the VS project, the VS project then fails when building release|ARM64 at:

MSB3030 Could not copy the file "C:\VRR_Repos\HLArtExhibit\Builds\Spectator\Art Installation Demo\Plugins\ARM64\opencv_core.dll" because it was not found.  Art Installation Demo   C:\VRR_Repos\HLArtExhibit\Builds\Spectator\Art Installation Demo\Unity Data.vcxitems    237 

So I'm stuck. Spent many hours yesterday trying to get this to work and half of today. So I'm going to have to assume this project (even at the new incoming PR) is not really ready for use. Big bummer as demo videos of 1st person view of HL apps is very limited.

chrisfromwork commented 4 years ago

We haven't tested this project for Unity 2019.3 and have been using variations of version 2019.2.. I don't think that Azure Spatial Anchors has been tested for Unity versions greater than 2019.2.. When building with Unity 2019.2. against the pull request you called out I don't see these script errors locally. It may be that a windows sdk is missing or this newer version of Unity introduces additional errors.

This sounds like you're hitting an issue because you are building for ARM64 when most folks up to this point have been building ARM projects for HoloLens 2 (ARM64 flavors seem to exist for me locally in visual studio 2019 but don't exist for me in visual studio 2017). This missing dll issue in visual studio is created by Unity. Once Unity sees that a dll exists for one flavor of UWP builds (x86, x64, ARM, etc), it believes that the dll should exist for all flavors. This causes the generated visual studio solution to break when dlls don't exist. We have some hacks in place to copy empty dlls for the ARM platform.

I've updated the pull request you called out to now populate/fix the arm64 dll errors you were seeing: https://github.com/microsoft/MixedReality-SpectatorView/pull/375

You'll need to rerun the package creation to pick up these changes. You'll then need to delete the application/visual studio project folder you created when building in Unity and rebuild in Unity for the WSA Player.