创建混合现实 3D 图标时如何解决 package.appxmanifest 中的命名空间错误?

How do I resolve a namespace error in package.appxmanifest when creating a Mixed Reality 3D Icon?

我正在尝试为 Unity 3D UWP 项目中的悬崖屋添加混合现实 3D 图标。

所以我遵循了官方文档 (https://docs.microsoft.com/en-us/windows/mixed-reality/implementing-3d-app-launchers),我的 package.appxmanifest 现在有这些行:

<Package xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:uap2="http://schemas.microsoft.com/appx/manifest/uap/windows10/2" xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3" xmlns:uap4="http://schemas.microsoft.com/appx/manifest/uap/windows10/4" xmlns:uap5="https://schemas.microsoft.com/appx/manifest/uap/windows10/5" xmlns:iot="http://schemas.microsoft.com/appx/manifest/iot/windows10" xmlns:mobile="http://schemas.microsoft.com/appx/manifest/mobile/windows10" IgnorableNamespaces="uap uap2 uap3 uap4 uap5 mp mobile iot" xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10">

<uap:DefaultTile ShortName="Kaldor - Your Public Art Project 2019" Wide310x150Logo="Assets\Wide310x150Logo.png" Square71x71Logo="Assets\Square71x71Logo.png" Square310x310Logo="Assets\Square310x310Logo.png">
  <uap:ShowNameOnTiles>
    <uap:ShowOn Tile="square310x310Logo" />
    <uap:ShowOn Tile="wide310x150Logo" />
  </uap:ShowNameOnTiles>
  <uap5:MixedRealityModel Path="Assets\StoreModel1.glb" />
</uap:DefaultTile>

但我收到此控制台错误:

The element 'DefaultTile' in namespace 'http://schemas.microsoft.com/appx/manifest/uap/windows10' has invalid child element 'MixedRealityModel' in namespace 'https://schemas.microsoft.com/appx/manifest/uap/windows10/5'. List of possible elements expected: 'TileUpdate' in namespace 'http://schemas.microsoft.com/appx/manifest/uap/windows10' as well as 'MixedRealityModel' in namespace 'http://schemas.microsoft.com/appx/manifest/uap/windows10/5' as well as 'HoloContentChoice' in namespace 'http://schemas.microsoft.com/appx/manifest/uap/windows10'.

我已经关注了文档和关于该主题的官方 MS 视频,但看不出我错过了什么?

您的包标签中的架构 URL 不一致。你对每个 URL 使用 http 除了 https://schemas.microsoft.com/appx/manifest/uap/windows10/5 你使用 https.

由于 uap10/5uap10 的子元素,并且由于您使用 http://schemas.microsoft.com/appx/manifest/uap/windows10,因此子元素需要 http://schemas.microsoft.com/appx/manifest/uap/windows10/5,而不是 https://schemas.microsoft.com/appx/manifest/uap/windows10/5。 (请注意 URL 中非常细微的差异。)

这正是您得到的错误:

The element 'DefaultTile' in namespace 'http://schemas.microsoft.com/appx/manifest/uap/windows10' has invalid child element 'MixedRealityModel' in namespace 'https://schemas.microsoft.com/appx/manifest/uap/windows10/5'.

它告诉你它期望 http:

List of possible elements expected: [...] as well as 'MixedRealityModel' in namespace 'http://schemas.microsoft.com/appx/manifest/uap/windows10/5'

但是,您不应将 10/5 切换为 http,而应将其他所有内容切换为 https