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

问题描述 投票:0回答:1

我正在尝试在Unity 3D UWP项目中为悬崖房屋添加一个MixedReality 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视频,看不到我错过的内容吗?

uwp manifest windows-mixed-reality
1个回答
0
投票

您的Package标记中的架构URL不一致。对于除http之外的每个URL,在每个URL上都使用https://schemas.microsoft.com/appx/manifest/uap/windows10/5

由于httpsuap10/5的子元素,并且由于您使用uap10,因此它将http://schemas.microsoft.com/appx/manifest/uap/windows10而不是http://schemas.microsoft.com/appx/manifest/uap/windows10/5用作子元素。 (请注意,URL的细微差别。)

这正是您得到的错误:

名称空间'https://schemas.microsoft.com/appx/manifest/uap/windows10/5'中的元素'DefaultTile'在名称空间'http://schemas.microsoft.com/appx/manifest/uap/windows10'中具有无效的子元素'MixedRealityModel'。

它告诉您https://schemas.microsoft.com/appx/manifest/uap/windows10/5除外:

可能的元素列表:[...]以及命名空间'http'中的'MixedRealityModel'

但是,除了将10/5切换到http://schemas.microsoft.com/appx/manifest/uap/windows10/5之外,还应该将其他所有内容切换到http

© www.soinside.com 2019 - 2024. All rights reserved.