microsoft / MixedReality-SpectatorView

Mixed reality spectator experiences
MIT License
193 stars 113 forks source link

Issues Compiling or Importing #370

Open InitusJames opened 4 years ago

InitusJames commented 4 years ago

This asset would be great if there were complete instructions on how to implement this source.

I can get so far but in the end I have 9 errors remaining. Any ideas what do do next?

I added the package with Package Manager.

I am using Unity 2019.2.21f1 AR Foundation 3.1.3 AR Subsystems 3.1.3 ARCore XR Plugin 3.1.3 ARKit XR Plugin 3.1.3

VS 2019

I find the instructions very limited and a few errors regarding paths I just don't see documented anywhere.

Any help would be appreciated.

C:\MRSV\packages\com.microsoft.mixedreality.spectatorview.0.0.1\SpatialAlignment.ASA\Scripts\AzureSpatialAnchors\CustomSpatialAnchorConfig.cs(6,46): error CS0246: The type or namespace name 'SpatialAnchorConfig' could not be found (are you missing a using directive or an assembly reference?)

C:\MRSV\packages\com.microsoft.mixedreality.spectatorview.0.0.1\SpatialAlignment.ASA\Scripts\AzureSpatialAnchors\CustomSpatialAnchorManager.cs(26,47): error CS0246: The type or namespace name 'SpatialAnchorManager' could not be found (are you missing a using directive or an assembly reference?)

C:\MRSV\packages\com.microsoft.mixedreality.spectatorview.0.0.1\SpatialAlignment.ASA\Scripts\SpatialAlignment\SpatialAnchorsCoordinate.cs(23,16): error CS0246: The type or namespace name 'CloudSpatialAnchor' could not be found (are you missing a using directive or an assembly reference?)

C:\MRSV\packages\com.microsoft.mixedreality.spectatorview.0.0.1\SpatialAlignment.ASA\Scripts\AzureSpatialAnchors\CustomSpatialAnchorManager.cs(32,46): error CS0246: The type or namespace name 'SpatialAnchorConfig' could not be found (are you missing a using directive or an assembly reference?)

C:\MRSV\packages\com.microsoft.mixedreality.spectatorview.0.0.1\SpatialAlignment.ASA\Scripts\AzureSpatialAnchors\CustomSpatialAnchorManager.cs(16,102): error CS0246: The type or namespace name 'SpatialAnchorConfig' could not be found (are you missing a using directive or an assembly reference?)

C:\MRSV\packages\com.microsoft.mixedreality.spectatorview.0.0.1\SpatialAlignment.ASA\Scripts\AzureSpatialAnchors\CustomSpatialAnchorManager.cs(16,23): error CS0246: The type or namespace name 'SpatialAnchorManager' could not be found (are you missing a using directive or an assembly reference?)

C:\MRSV\packages\com.microsoft.mixedreality.spectatorview.0.0.1\SpatialAlignment.ASA\Scripts\SpatialAlignment\SpatialAnchorsCoordinate.cs(73,41): error CS0246: The type or namespace name 'CloudSpatialAnchor' could not be found (are you missing a using directive or an assembly reference?)

C:\MRSV\packages\com.microsoft.mixedreality.spectatorview.0.0.1\SpatialAlignment.ASA\Scripts\SpatialAlignment\SpatialAnchorsCoordinateService.cs(194,59): error CS0246: The type or namespace name 'AnchorLocatedEventArgs' could not be found (are you missing a using directive or an assembly reference?)

C:\MRSV\packages\com.microsoft.mixedreality.spectatorview.0.0.1\SpatialAlignment.ASA\Scripts\SpatialAlignment\SpatialAnchorsCoordinateService.cs(22,17): error CS0246: The type or namespace name 'SpatialAnchorManager' could not be found (are you missing a using directive or an assembly reference?)

chrisfromwork commented 4 years ago

These errors suggest that Azure Spatial Anchors wasn't included in your created Unity package. If you look in src\SpectatorView.Unity\Assets\SpatialAlignment.ASA\AzureSpatialAnchors.SDK and src\SpectatorView.Unity\Assets\SpatialAlignment.ASA.Editor, do the symbolic links to the external\Azure-SpatialAnchors-Samples project work? My guess is that there may have been errors when running the CreateUnityPackage.ps1 script related to setting up symbolic links?

InitusJames commented 4 years ago

I have 1 error when compiling

Call Stack (most recent call first): scripts/cmake/vcpkg_configure_cmake.cmake:297 (vcpkg_execute_required_process) ports/libjpeg-turbo/portfile.cmake:33 (vcpkg_configure_cmake) scripts/ports.cmake:90 (include)

Error: Building package libjpeg-turbo:x86-uwp failed with: BUILD_FAILED Please ensure you're using the latest portfiles with .\vcpkg update, then submit an issue at https://github.com/Microsoft/vcpkg/issues including: Package: libjpeg-turbo:x86-uwp Vcpkg version: 2020.02.04-nohash

otherwise the build looks good

InitusJames commented 4 years ago

C:\MRSV\tools\Scripts>createunitypackage Setting up the repository...

Enabling symbolic links for the repository. fatal: not in a git directory Configuring the repository to use crlf line endings. fatal: not in a git directory Updating spectator view related submodules. fatal: not a git repository (or any of the parent directories): .git fatal: not a git repository (or any of the parent directories): .git Fixing symbolic links for the following directory: C:\MRSV\tools\Scripts....\src\SpectatorView.Unity\ fatal: not a git repository (or any of the parent directories): .git Fixing symbolic links for the following directory: C:\MRSV\tools\Scripts....\samples\Build2019Demo.Unity\ fatal: not a git repository (or any of the parent directories): .git

Directory: C:\MRSV\external\MixedReality-QRCodePlugin\UnityFiles\Microsoft.MixedReality.QR.0.5.2100

Mode LastWriteTime Length Name


d----- 2020-05-11 4:53 PM Unity

Directory: C:\MRSV\external\MixedReality-QRCodePlugin\UnityFiles\Microsoft.MixedReality.QR.0.5.2100\lib

Mode LastWriteTime Length Name


d----- 2020-05-11 4:53 PM net46

Directory: C:\MRSV\external\MixedReality-QRCodePlugin\UnityFiles\Microsoft.VCRTForwarders.140.1.0.5

Mode LastWriteTime Length Name


d----- 2020-05-11 4:53 PM Unity WARNING: Blackmagic decklink resources weren't found at C:\MRSV\tools\ci\scripts......\external\Blackmagic DeckLink SDK 10.9.11, Blackmagic decklink filming won't be included in the build. WARNING: Azure Kinect SDK wasn't found at C:\Program Files\Azure Kinect SDK v1.3.0, Azure Kinect filming won't be included in the build. WARNING: Azure Kinect Body Tracking SDK wasn't found at C:\Program Files\Azure Kinect Body Tracking SDK 1.0.0, Azure Kinect Body Tracking filming won't be included in the build.

Setting up external dependencies Succeeded: True

Setting up elgato dependencies Adding submodule:https://github.com/elgatosf/gamecapture.git at external\gamecapture fatal: not a git repository (or any of the parent directories): .git

Adding elgato dependencies succeeded: True

Building OpenCV Updaing vcpkg submodule to master branch fatal: not a git repository (or any of the parent directories): .git Preparing vcpkg

Building vcpkg.exe ...

pch.cpp archives.cpp checks.cpp chrono.cpp cofffilereader.cpp downloads.cpp enums.cpp files.cpp hash.cpp json.cpp machinetype.cpp parse.cpp strings.cpp stringview.cpp system.cpp system.print.cpp system.process.cpp unicode.cpp binarycaching.cpp binaryparagraph.cpp build.cpp cmakevars.cpp commands.autocomplete.cpp commands.buildexternal.cpp commands.cache.cpp commands.ci.cpp commands.contact.cpp commands.cpp commands.create.cpp commands.dependinfo.cpp commands.edit.cpp commands.env.cpp commands.exportifw.cpp commands.import.cpp commands.integrate.cpp commands.list.cpp commands.owns.cpp commands.porthistory.cpp commands.portsdiff.cpp commands.search.cpp commands.setinstalled.cpp commands.upgrade.cpp commands.version.cpp commands.xvsinstances.cpp dependencies.cpp export.cpp export.chocolatey.cpp export.prefab.cpp globalstate.cpp help.cpp input.cpp install.cpp logicexpression.cpp metrics.cpp packagespec.cpp paragraphparseresult.cpp paragraphs.cpp portfileprovider.cpp postbuildlint.buildtype.cpp postbuildlint.cpp remove.cpp sourceparagraph.cpp statusparagraph.cpp statusparagraphs.cpp tools.cpp triplet.cpp update.cpp userconfig.cpp vcpkgcmdarguments.cpp vcpkglib.cpp vcpkgpaths.cpp versiont.cpp visualstudio.cpp vcpkglib.vcxproj -> C:\MRSV\external\vcpkg\toolsrc\msbuild.x86.release\vcpkglib.lib vcpkg.cpp Generating code Previous IPDB not found, fall back to full compilation. All 17630 functions were compiled because no usable IPDB/IOBJ from previous compilation was found. Finished generating code vcpkg.vcxproj -> C:\MRSV\external\vcpkg\toolsrc\msbuild.x86.release\vcpkg.exe vcpkgmetricsuploader.cpp Generating code Previous IPDB not found, fall back to full compilation. All 6758 functions were compiled because no usable IPDB/IOBJ from previous compilation was found. Finished generating code vcpkgmetricsuploader.vcxproj -> C:\MRSV\external\vcpkg\toolsrc\msbuild.x86.release\vcpkgmetricsuploader.exe

Building vcpkg.exe... done.

Telemetry

vcpkg collects usage data in order to help us improve your experience. The data collected by Microsoft is anonymous. You can opt-out of telemetry by re-running bootstrap-vcpkg.bat with -disableMetrics. Read more about vcpkg telemetry at docs/about/privacy.md

Setting vcpkg installs to be available to MSBuild Applied user-wide integration for this vcpkg root.

All MSBuild C++ projects can now #include any installed libraries. Linking will be handled automatically. Installing new libraries will make them instantly available.

CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=C:/MRSV/external/vcpkg/scripts/buildsystems/vcpkg.cmake" Updating vcpkg Using local portfile versions. To update the local portfiles, use git pull. No packages need updating. Upgrading vcpkg All installed packages are up-to-date with the local portfiles. Found install directory for x86 protobuf windows, skipping build Building OpenCV x86 UWP Computing installation plan... Warning: qualifier has changed meaning recently: windows The following packages will be built and installed:

Call Stack (most recent call first): scripts/cmake/vcpkg_configure_cmake.cmake:297 (vcpkg_execute_required_process) ports/libjpeg-turbo/portfile.cmake:33 (vcpkg_configure_cmake) scripts/ports.cmake:90 (include)

Error: Building package libjpeg-turbo:x86-uwp failed with: BUILD_FAILED Please ensure you're using the latest portfiles with .\vcpkg update, then submit an issue at https://github.com/Microsoft/vcpkg/issues including: Package: libjpeg-turbo:x86-uwp Vcpkg version: 2020.02.04-nohash

Additionally, attach any relevant sections from the log files above. Found install directory for x64 OpenCV windows, skipping build

OpenCV Build Completed: x86 Dependencies Succeeded: True x86 UWP OpenCV Succeeded: False x64 Desktop OpenCV Succeeded: True

OpenCV Build Succeeded: False

Native Project Setup Suceeded: False

SpectatorView.Native Build Results: Setup Succeeded: False x86 Build Succeeded: False x64 Build Succeeded: False ARM Build Succeeded: False Copy Native Plugins Succeeded: False

Included Compositor Components: Blackmagic Decklink: False Elgato: True Azure Kinect SDK: False Azure Kinect Body Tracking SDK: False

Build Succeeded: False

Creating package com.microsoft.mixedreality.spectatorview.0.0.1

Directory: C:\MRSV\packages

Mode LastWriteTime Length Name


d----- 2020-05-11 4:54 PM com.microsoft.mixedreality.spectatorview.0.0.1 Created package: packages/com.microsoft.mixedreality.spectatorview.0.0.1.zip Unzip and reference this package in your project as needed.

chrisfromwork commented 4 years ago

Some of the errors suggest that you may have just copied the project content compared to cloning the repo. You can clone the repo with the following command:

git clone https://github.com/microsoft/MixedReality-SpectatorView.git

I have a review here that will allow creating a unity package without using symbolic links: https://github.com/microsoft/MixedReality-SpectatorView/pull/375 With these changes you can run tools\scripts\CreateUnityPackage.bat -HardCopySymbolicLinks if your development environment doesn't support symbolic links.

What commit for vcpkg are you using?

InitusJames commented 4 years ago

ok, looks like the script fails on Error: Building package libjpeg-turbo:x86-uwp failed with: BUILD_FAILED

However, it still imports into Unity. It's progress but I just need to fix that 1 error somehow.

The VCPKG was acquired with git clone from master, so whatever commit that is , is what i have **Previous errors re : ASA are now resolved

chrisfromwork commented 4 years ago

BuildOpenCV in tools\ci\scripts\spectatorViewHelpers.psm1 will pull down the newest version of vcpkg available. If you try the following steps to attempt rebuilding libjpeg-turoba:x86-uwp, do you see the same issues?

cd external\vcpkg git pull origin master vcpkg.exe upgrade --no-dry-run vcpkg.exe install libjpeg-turbo:x86-uwp

If so, our best bet is going to be filing an issue against the vcpkg repo to try and unblock. It looks like someone may have already filed an issue for this package here (I think based on other issues folks have encountered with this project): https://github.com/microsoft/vcpkg/issues/11296

Looking at this issue, do you know if you have both the windows desktop sdk as well as the windows 10.0 store sdk? You can check this with the following:

  1. Run the visual studio installer
  2. Choose to modify your current install of visual studio
  3. Ensure you have installed both the Universal Windows Platform development and Desktop development with C++ options

FWIW, you don't really need native components for mobile filming + HoloLens 2. Referencing the src\SpectatorView\Assets\package.json in your Unity project may be enough to unblock if you aren't using a HoloLens 1 and aren't attempting azure kinect/video camera filming.

InitusJames commented 4 years ago

Didn't seem to work

C:\MRSV\MixedReality-SpectatorView\external\vcpkg>git pull origin master remote: Enumerating objects: 18, done. remote: Counting objects: 100% (18/18), done. remote: Compressing objects: 100% (2/2), done. remote: Total 40 (delta 16), reused 17 (delta 16), pack-reused 22 Unpacking objects: 100% (40/40), 17.25 KiB | 178.00 KiB/s, done. From https://github.com/microsoft/vcpkg

C:\MRSV\MixedReality-SpectatorView\external\vcpkg>vcpkg.exe upgrade --no-dry-run All installed packages are up-to-date with the local portfiles.

C:\MRSV\MixedReality-SpectatorView\external\vcpkg>vcpkg.exe install libjpeg-turbo:x86-uwp Computing installation plan... The following packages will be built and installed: libjpeg-turbo[core]:x86-uwp Starting package 1/1: libjpeg-turbo:x86-uwp Building package libjpeg-turbo[core]:x86-uwp... -- Using community triplet x86-uwp. This triplet configuration is not guaranteed to succeed. -- [COMMUNITY] Loading triplet configuration from: C:\MRSV\MixedReality-SpectatorView\external\vcpkg\triplets\community\x86-uwp.cmake -- Using cached C:/MRSV/MixedReality-SpectatorView/external/vcpkg/downloads/libjpeg-turbo-libjpeg-turbo-166e34213e4f4e2363ce058a7bcc69fd03e38b76.tar.gz -- Using source at C:/MRSV/MixedReality-SpectatorView/external/vcpkg/buildtrees/libjpeg-turbo/src/fd03e38b76-a5b0f5fafe -- Configuring x86-uwp CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:72 (message): Command failed: ninja -v Working Directory: C:/MRSV/MixedReality-SpectatorView/external/vcpkg/buildtrees/libjpeg-turbo/x86-uwp-rel/vcpkg-parallel-configure Error code: 1 See logs for more information: C:\MRSV\MixedReality-SpectatorView\external\vcpkg\buildtrees\libjpeg-turbo\config-x86-uwp-out.log

Call Stack (most recent call first): scripts/cmake/vcpkg_configure_cmake.cmake:297 (vcpkg_execute_required_process) ports/libjpeg-turbo/portfile.cmake:33 (vcpkg_configure_cmake) scripts/ports.cmake:90 (include)

Error: Building package libjpeg-turbo:x86-uwp failed with: BUILD_FAILED Please ensure you're using the latest portfiles with .\vcpkg update, then submit an issue at https://github.com/Microsoft/vcpkg/issues including: Package: libjpeg-turbo:x86-uwp Vcpkg version: 2020.02.04-nohash

Additionally, attach any relevant sections from the log files above.

InitusJames commented 4 years ago

seems to have built with no errors, but now I have 2 in Unity.

fyi, the setup is hopefully going to be 2x HL2... one used to demonstrate the other paired with a Camera as the spectator view which will stream the experience.

Failed to find single asset for vcruntime140_app.dll; found 0 instead! UnityEngine.Debug:LogError(Object) InitVCRTForwarders:.cctor() (at C:/MRSV/MixedReality-SpectatorView/packages/com.microsoft.mixedreality.spectatorview.0.0.1/SpectatorView.ExternalDependencies/UnityFiles/Microsoft.VCRTForwarders.140.1.0.5/Editor/InitVCRTForwarders.cs:39) UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes(Type[]) (at C:/buildslave/unity/build/Editor/Mono/EditorAssemblies.cs:108)

Failed to set DLL directory C:\Users\james\Desktop\specview\Packages\com.microsoft.mixedreality.spectatorview\SpectatorView.ExternalDependencies\UnityFiles\Microsoft.MixedReality.QR.0.5.2100\x64: Win32 error 3 UnityEngine.Debug:LogError(Object) Microsoft.MixedReality.QR.Init:.cctor() (at C:/MRSV/MixedReality-SpectatorView/packages/com.microsoft.mixedreality.spectatorview.0.0.1/SpectatorView.ExternalDependencies/UnityFiles/Microsoft.MixedReality.QR.0.5.2100/Editor/Microsoft.MixedReality.QR.Init.cs:57) UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes(Type[]) (at C:/buildslave/unity/build/Editor/Mono/EditorAssemblies.cs:108)

chrisfromwork commented 4 years ago

The failed to set dll directory errors should be fixed in the following review: https://github.com/microsoft/MixedReality-SpectatorView/pull/375

An immediate work around is to delete all .cs files that get included in the SpectatorView.ExternalDependencies\UnityFiles folder that your project references. This is related to a few issues I have filed against the projects:

https://github.com/microsoft/vcrt-forwarders/issues/23 https://github.com/microsoft/vcrt-forwarders/issues/24