我目前正在与 Microsoft 合作解决您的一个 UWP 应用程序在启动后崩溃的情况。在围绕 msbuild 进行了大量调试后,我认识到只有在生成的 appxbundle 文件分布在 Microsoft App Center(又名 Mobile Center)上时才会发生崩溃。这也是只有当 appxbundle 使用 VSTS 内置任务“App Center 分发”上传到 App Center 时才会出现这种情况。
当我使用 App Center 门户手动上传 appxbundle 时,它一切正常,即使通过 App Center 使用也是如此。
此外,我注意到构建后 appxbundle 的大小为 18MB,但使用 VSTS 任务上传到 App Center 时只有 14MB 的大小(大小显示在 App Center Portal 中)。下载后文件未损坏,但似乎缺少捆绑包中的某些文件 - 此任务在做什么?打开和修改 appxbundle?呵呵。
有人有类似的问题吗?
最佳答案
我暂时解决了这个问题,将内置任务替换为 App Center CLI 和一个简单的 powershell 脚本来存档相同的任务。
param(
[Parameter(Mandatory=$true)]
[String]
$Token,
# Name of the App, e.g. 'org/app'
[Parameter(Mandatory=$true)]
[String]
$App,
# Name of the distribution Group, e.g. 'Collaborators'
[Parameter(Mandatory=$true)]
[String]
$Group
)
$binaryFile = (Get-ChildItem MyApp_*_x64.appxbundle -Recurse).FullName
appcenter distribute release -g $Group -f "$binaryFile" -a $App --debug --token $Token
要使此脚本工作,您需要最新版本的 App Center CLI,可以在 here 中找到。 .
在带有 NPM 包管理器的构建代理上,您只需运行
npm install -g appcenter-cli
安装最新版本。之后应该执行上面的脚本。
关于uwp - 使用 VSTS 任务将 UWP 应用分发到应用中心(又名移动中心),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47730034/