首页 > 解决方案 > 如何从构建中排除 WinPhone

问题描述

我有一个 Xamarin.Forms 应用程序,它支持 iOS、Android 和 UWP。当我尝试使用 Azure 管道将其提交到 Windows Store 时,我对后者有疑问。我不断收到错误消息:

状态 400:{"code":"InvalidParameterValue","data":[],"details":[],"message":"AllowTargetFutureDeviceFamilies 未使用所有支持的平台进行更新:[Desktop、Mobile、Xbox、全息]","source":"Ingestion Api","target":"allowTargetFutureDeviceFamilies"} CorrelationId: d6b9d6a2-6906-4908-9832-28c8f3c45a36

以下是合作伙伴中心的外观:

在此处输入图像描述

看起来这个问题与 app.xap 和 Windows Phone 有关。我们不支持 Windows Phone,因此它在 Package.appxmanifest 中的外观如下:

<Dependencies>
   <TargetDeviceFamily Name="Windows.Mobile" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
   <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
</Dependencies>

这是我的 UWP 项目的目标平台版本:

<TargetPlatformVersion>10.0.18362.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>

这是我的一些管道信息:

steps:
- task: richardfennellBM.BM-VSTS-Versioning-Task.Version-APPX-Task.VersionAPPX@2
displayName: 'Bump UWP Versions'
inputs:
  VersionNumber: '$(Build.BuildNumber).0'
  InjectVersion: true

variables:
   BuildConfiguration: 'Release'

steps:
  - task: VSBuild@1
  displayName: 'Build project **\*UWP.csproj'
  inputs:
     solution: '**\*UWP.csproj'
     msbuildArgs: '/p:AppxBundlePlatforms=x86 
 /p:AppxPackageDir="$(Build.ArtifactStagingDirectory)\AppxPackages\\" 
 /p:AppxBundle=Always /p:UapAppxPackageBuildMode=StoreUpload'
     platform: x86
     configuration: '$(BuildConfiguration)'
     clean: true

如何提交我的应用程序?如果这是问题,我该如何摆脱 Windows Phone?

标签: xamarin.formsuwp

解决方案


推荐阅读