Xamarin“可执行文件的签名无效" [英] Xamarin "The executable was signed with invalid entitlements"

查看:21
本文介绍了Xamarin“可执行文件的签名无效"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的 iPhone 上测试我创建的 iOS 应用.构建成功,但当 xamarin studio 尝试通过 USB 将文件传输到我的 iPhone 时,我收到以下错误:

I want to test my created iOS app on my iPhone. The build was successful but while xamarin studio tries to transfer the file via usb to my iPhone i got the following error:

VerifyingApplication: 70%
  PercentComplete: 40
  Status: VerifyingApplication
 ApplicationVerificationFailed: Failed to verify code signature of /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.yNZx88/extracted/<APPName>.app : 0xe8008016 (The executable was signed with invalid entitlements.)
error MT1006: Could not install the application '/Users/<NAME>/Projects/<APPName>/<APPName>/bin/iPhone/Debug/device-builds/iphone8.2-10.2.1/<APPNamr>.app' on the device '<DEVICEName>': Your code signing/provisioning profiles are not correctly configured. Probably you have an entitlement not supported by your current provisioning profile, or your device is not part of the current provisioning profile. Please check the iOS Device Log for details (error: 0xe8008016).
--- inner exception
Xamarin.Installation.FailedInstallException: Your code signing/provisioning profiles are not correctly configured. Probably you have an entitlement not supported by your current provisioning profile, or your device is not part of the current provisioning profile. Please check the iOS Device Log for details (error: 0xe8008016)

[...]

Application could not be uploaded to the device.

我是 xamarin 的新手,不知道该怎么做.可以使用苹果开发者帐户并创建证书和配置文件.手机被添加到设备列表中,并创建了一个标识符.

I'm new to xamarin and don't know what to do. A apple developer account is available and the certificate and provisioning Profile are created. The phone is added to device list and a identifier is are created.

有人可以帮我吗?

推荐答案

更新:

首先,确保 Xcode 和 Visual Studio for Mac 都更新到最新版本.如果您更新 Xcode,请打开它.登录.如果它要求安装其他必需的组件?",请选择安装".然后重新打开更新后的VS.

First, make sure both Xcode and Visual Studio for Mac are updated to latest versions. If you update Xcode, open it. Sign in. If it asks to "Install additional required components?", pick "Install". Then re-open the updated VS.

使用较新的 Visual Studio for Mac 和 Xcode,您可能会在部署到设备"中获得所需的所有信息.当您启动电话(从 VS)调试时出现的选项卡 |您的应用程序的 iPhone 版本.滚动到该选项卡的底部,查找如下消息:

With newer Visual Studio for Mac and Xcode, you might have all the info you need in the "Deploying to Device" tab that appears when you launch to phone (from VS) a Debug | iPhone version of your app. Scroll to bottom of that tab, look for a message like:

ApplicationVerificationFailed:无法验证...的代码签名(可执行文件的签名无效.)

ApplicationVerificationFailed: Failed to verify code signature of ... (The executable was signed with invalid entitlements.)

...您的代码签名/配置文件配置不正确.可能您的当前配置文件不支持您的权利,或者您的设备不是当前配置文件的一部分.详情请查看 iOS 设备日志(错误:0xe8008016).

... Your code signing/provisioning profiles are not correctly configured. Probably you have an entitlement not supported by your current provisioning profile, or your device is not part of the current provisioning profile. Please check the iOS Device Log for details (error: 0xe8008016).

在某些情况下,以下说明不会为您提供比以上说明更有用的详细信息.例如,我没有看到(即使在 iOS 设备日志中) 授权失败;我必须通过比较我的应用在 info.plist 中签入的权利和我使用的证书来解决上述问题.如果有疑问,请尝试取消选中info.plist 中的所有权利.再次部署.(显然,任何需要授权的功能都无法使用,但至少您可以验证您是否能够在没有该错误消息的情况下进行部署.)

In some situations, the instructions below won't give you any more useful detail than the above. For example, I'm not seeing (even in iOS Device Log) which entitlement is failing; I had to fix the above by comparing the entitlements my app had checked in info.plist, with the certificate I was using. If in doubt, try unchecking all entitlements in info.plist. Deploy again. (Obviously any functionality that needs the entitlement won't work, but at least you can verify you are able to deploy without that error message.)

原答案:

(关于问题的评论)您需要的不是 Xcode 中的日志——那些是 crash 日志.这里需要的是 Xamarin/View/Pads/设备日志".安装应用时,消息会滚动.

(Regarding comments on the question) What you need is NOT the logs in Xcode - those are crash logs. What is needed here is in Xamarin / View / Pads / "Device Log". While installing the app, messages will scroll by.

在开始安装之前打开设备日志板 - 它是手机消息的动态显示.从键盘左上角的下拉列表中选择您的手机.(随时点击pad右上方的橡皮擦图标,清除旧信息.)

Open the Device Log pad before starting the install - it is a dynamic display of messages from your phone. Select your phone from the dropdown list at top left of pad. (At any time, click eraser icon at top right of pad, to clear the old messages.)

如果有许多消息正在滚动,则单击 i-inside-blue-circle 图标(工具提示显示消息")(取消选择它)以隐藏信息消息.确保选中 x-in-red-circle 图标(工具提示显示错误").

If many messages are scrolling by, then click on the i-inside-blue-circle icon (tooltip "Show Messages") (unselect it) to hide the Info messages. Make sure that x-in-red-circle icon (tooltip "Show Errors") is selected.

安装失败后,全选/复制/粘贴";进入文本编辑器.搜索安装失败.在它之前应该是一些提供更多信息的行.具体来说,它将阐明这两种可能性中的哪一种是问题:1) 权利 或 2) 与设备有关.

After the install fails, "select all / copy / paste" into a text editor. Search for the install failure. Immediately before it should be some lines that give more information. Specifically, it will clarify which of these two possibilities is the problem: 1) entitlements or 2) something about device.

我敢打赌它的权利.您需要隔离导致问题的权利.您是否使用推送通知?iCloud?这些很可能是罪魁祸首.或者也许是与隐私相关的权利之一 - 请确保您遵循最新 iOS 版本的当前说明:在 iOS 10、12 和 13 (IIRC) 中添加了新的隐私设置.

I'll bet its entitlements. You'll need to isolate what entitlement is causing the problem. Are you using Push Notifications? iCloud? Those are likely culprits. Or perhaps one of the privacy related entitlements - make sure you are following current instructions for the latest iOS version: new privacy settings were added in iOS 10, then 12, then 13 (IIRC).

查看Entitlements.plist的源代码.在远离项目的地方保存一份副本.从空白(空)Entitlements.plist 开始.[添加一个具有该名称的空文本文件,如果您的项目文件夹中没有它.] 然后您可以部署到手机吗?

Look at source code of Entitlements.plist. Save a copy of that somewhere away from your project. Start with a blank (empty) Entitlements.plist. [Add an empty text file with that name, if you don't have it in your project folder.] Are you then able to deploy to phone?

当然,您将无法使用您需要的权利,虽然这是空白的,但您应该能够启动应用程序的第一个屏幕,或者至少一些Apple 对话框询问用户是否允许..您需要的任何权利..

Of course, you won't be able to use the entitlements you need, while this is blank, but you should be able to get the first screen of your app up, or at least some Apple dialog asking user if they want to allow ..whatever entitlement you needed..

然后添加到Entitlements.plist 直到无法部署.然后针对该特定问题进行 Google 搜索 - 希望有解决方案.

Then add to Entitlements.plist until you can't deploy. Then Google for that specific problem - hopefully there is a solution out there.

另一种可能是您的配置文件缺少您要求的权利.返回 Apple 开发者网站,其中列出了您的证书和配置文件.选择省.您正在使用的配置文件.在启用的服务"下,确保它列出了您正在使用的服务.
(某些 Apple 功能不需要特定的权利;如果有疑问,请创建一个新的配置文件,并仔细查看您正在使用的任何功能的所有权利选项.)

Another possibility is that your provisioning profile lacks an entitlement that you are asking for. Go back to Apple developer website, where your certificates and provisioning profiles are listed. Select the prov. profile you are using. Under "Enabled Services", make sure it lists the services you are using.
(Some Apple features don't require specific entitlements; if in doubt, create a new provisioning profile, and look carefully at all the options for entitlements, for any feature you are using.)

这篇关于Xamarin“可执行文件的签名无效"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆