Xamarin“可执行文件已使用无效的权利进行了签名" [英] Xamarin "The executable was signed with invalid entitlements"

查看:123
本文介绍了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.

使用更新的Mac和Xcode Visual Studio,您可能会在部署到设备"中获得所需的所有信息.从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/"Device Log" 中. 在安装应用程序时,消息将滚动显示.

(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.

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

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图标(工具提示"Show Messages")(取消选择它)以隐藏Info消息.确保已选中红色圆圈"图标(工具提示显示错误").

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 ?这些可能是罪魁祸首.也许是与 privacy 相关的权利之一-确保您遵循有关最新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天全站免登陆