Win10 UWP系列:更新UWP时注意的问题——TargetDeviceFamily

前几天把CurrencyExchanger提交到微软参加Master认证,结果没有通过,反馈了一些错误,看来微软检查还是比较仔细的。

错误主要有:

Visual feedback helps users recognize whether their interactions with your application are detected, interpreted, and handled as they intended.

就是说如果一个列表项点击后没有任何动作的话,不应该有触摸反馈。UWP的ListView项默认会带Tilt效果,以前WP8的时候还要通过另外的Toolkit来实现,现在自带了,反而要想办法去掉。解决办法是自定义ListView的ItemContainerStyle,去掉里面的VisualStateGroup就可以了。

 

再一个错误:

Windows 10 applications should properly navigate back through pages when using the Windows 10 system back button.

在开发的时候主要针对PC和手机来进行了测试,手机有硬件返回键,所以处理了返回键的事件,PC没有返回键,就没做,但PC有一个平板模式,是可以显示返回键的,这个地方也需要处理。解决办法是增加处理SystemNavigationManager.GetForCurrentView().BackRequested事件即可。

 

再一个错误是功能性的,搜索货币时无法正常搜索,经检查代码是搜索内容忘了进行大小写转换,可以搜索小写字母,大写字母就搜不到了,属于粗心错误。统一ToUpper或者ToLower就可以了。

还有一个错误是这样的:

The following recommendation is optional and not required for STARTS compliance. With Windows 10 developers can write a single application that can be installed across a variety of device families including Mobile, Desktop, and XBOX. By default, Windows 10 applications target all device families. In the application manifest, this is called out as the ‘Universal’ Target Device Family. Such applications will be tested against all device form factors where this application may be deployed. Alternatively, developers can limit the device families for which an application can be deployed. For example, if ‘Desktop’ is specified and the Target Device Family, that application can only be installed on PC devices. When published, this application will only be available in the Store running on PCs – it will not be available in the Phone store.

 

The manifest file has Universal as TargetDeviceFamily. The application currently targets only desktop and mobile. It is recommended that the manifest entry is restricted only to supported devices and that a minimum of two device families are supported.

意思是说既然只支持PC和Mobile,就不要把TargetDeviceFamily设置为Universal。我就想当然的在Package.appsmanifest文件里修改了TargetDeviceFamily,设置为只有Desktop和Mobile。

 

还有一个错误:

The application should adapt properly to portrait or landscape view if supported.

这个是因为在635等分辨率低的机型上运行时,部分字体被截断了。而且在横屏的时候计算器界面也没显示完全。所以发布时应尽可能测试不同分辨率机型保持界面可用性。我调整了国旗图标大小,并且只支持竖屏状态,去掉了横屏支持。

 

然后顺手修复了几个小bug,开始上传商店。上传后在分析包的过程中出现以下错误:

XD.UWP.CurrencyExchanger_3.1.3.0_x86_x64_arm_bundle.appxupload28.0 MB

此程序包面向最低版本 10.0.0.0,但其依赖于面向最低版本 10.0.10042.0 的框架 Microsoft.VCLibs.140.00 14.0.22929.0。更新程序包中的最小值以指定 10.0.10042.0 的值或更大的值。
此程序包面向最低版本 10.0.0.0,但其依赖于面向最低版本 10.0.10049.0 的框架 Microsoft.NET.Native.Framework.1.2 1.2.23231.0。更新程序包中的最小值以指定 10.0.10049.0 的值或更大的值。
此程序包面向最低版本 10.0.0.0,但其依赖于面向最低版本 10.0.10049.0 的框架 Microsoft.NET.Native.Runtime.1.1 1.1.23406.0。更新程序包中的最小值以指定 10.0.10049.0 的值或更大的值。
 
该项目是以10586版本开发的, 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>

于是想当然的把MinVersion改为了10.0.10586.0,但是编译时又报错,说MaxVersionTested不能小于Minversion,于是又把MaxVersionTested也改为10586,还是不行。

这就奇怪了,上次上传的时候也没改这个地方啊。看到有说VC++引用版本错误,又重新升级了一下Sqlite组件,结果还是不行。

UWP的打包速度很慢,反复了好几次,不管是分三个包上传还是一个bundle包,都是一样的错误。

反复对比之后,只能怀疑TargetDeviceFamily了,将Mobile和Desktop改回原来的Universal,再上传就成功了。

暂时没找到这是什么原因导致,难道发布过一次Universal后就只能发布Universal了?

如果您也有遇到类似问题欢迎讨论。

 
posted @   yan_xiaodi  阅读(1700)  评论(1编辑  收藏  举报
编辑推荐:
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
阅读排行:
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· Ollama——大语言模型本地部署的极速利器
· DeepSeek如何颠覆传统软件测试?测试工程师会被淘汰吗?
点击右上角即可分享
微信分享提示