ios Xcode 可执行文件的签名无效

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/28811509/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 05:04:21  来源:igfitidea点击:

Xcode The executable was signed with invalid entitlements

iosiphonexcode

提问by Join

I would install an application in my mobile phone by using Xcode but it was not installed with following an error message.

我会使用 Xcode 在我的手机中安装一个应用程序,但它没有安装,并出现以下错误消息。

  • Error Message
    "The executable was signed with invalid entitlements. The entitlements specified in your application's Code Signing Entitlements file do not match those specified in your provisioning profile. (0xE8008016)"
  • 错误消息
    “可执行文件使用无效权利签名。应用程序代码签名权利文件中指定的权利与您的配置文件中指定的权利不匹配。(0xE8008016)”



  • Matters of Inquiry
    1. Why does the error message occur while I install the application?
    2. Would you mind if you can give me the solution of this problem?
  • 查询事项
    1. 为什么在安装应用程序时会出现错误信息?
    2. 你介意你给我这个问题的解决方案吗?

回答by Anuj Panwar

Check if you are using Entitlement file in Build Setting > Code Signing Section. If yes, try deleting that file name.

检查您是否在构建设置 > 代码签名部分中使用权利文件。如果是,请尝试删除该文件名。

回答by Priyansh

You are using wrong provisioning profile to build your app on devices make sure you are using right type of profile. I was using App Store Deployment profile to build on devices. Use ad-hoc profiles or development profiles to build on your devices.

您正在使用错误的配置文件在设备上构建您的应用程序,请确保您使用的是正确类型的配置文件。我正在使用 App Store 部署配置文件在设备上进行构建。使用临时配置文件或开发配置文件在您的设备上进行构建。

回答by Jaseem Abbas

You are using Entitlement file

您正在使用权利文件

The entitlements file defines certain capabilities of your app. Usually, the file is automatically generated by Xcode when you enable a capability for your app. You only need the file if you enable certain capabilities, e.g. Healthkit integration. If you'd like to use these features, you have to add it. Otherwise, Apple will reject your app.

权利文件定义了应用程序的某些功能。通常,当您为应用启用功能时,Xcode 会自动生成该文件。只有在启用某些功能(例如 Healthkit 集成)时才需要该文件。如果您想使用这些功能,则必须添加它。否则,Apple 将拒绝您的应用。

To fix this

要解决这个问题

  • Go to the build settings of your target.
  • Make sure that you have "All" selected instead of "Basic"
  • Type "entitlements" into the search box
  • The result is the build setting where you can specify where your entitlements file is located
  • Remove them
  • 转到目标的构建设置。
  • 确保您选择了“全部”而不是“基本”
  • 在搜索框中输入“权利”
  • 结果是构建设置,您可以在其中指定您的权利文件所在的位置
  • 删除它们

You are using the wrong Provisioning Profile

您使用了错误的配置文件

A provisioning profile is a collection of digital entities that uniquely ties developers and devices to an authorized iPhone Development Team and enables a device to be used for testing. A Development Provisioning Profile must be installed on each device on which you wish to run your application code.

配置文件是一组数字实体,可将开发人员和设备与授权的 iPhone 开发团队唯一地联系起来,并使设备能够用于测试。开发供应配置文件必须安装在您希望运行应用程序代码的每台设备上。

  • Go to Build Settings > Code Signing > Provisioning Profile
  • Select a development profile under Team
  • 转到构建设置 > 代码签名 > 配置文件
  • 在团队下选择一个开发配置文件

Please ensure that the Team in the project, target and tests are the same.

请确保项目中的团队、目标和测试是相同的。

Bundle Identifier and App ID do not match

Bundle Identifier 和 App ID 不匹配

  • Go to the build settings of your target
  • Select Packaging and change your App ID to match the Bundle ID
  • 转到目标的构建设置
  • 选择 Packaging 并更改您的 App ID 以匹配 Bundle ID

Clear cache in Xcode

清除 Xcode 中的缓存

Command-Option-Shift-K to clean out the build folder. Even better, quit Xcode and clean out ~/Library/Developer/Xcode/DerivedData manually.

Command-Option-Shift-K 清除构建文件夹。更好的是,退出 Xcode 并手动清理 ~/Library/Developer/Xcode/DerivedData。

回答by fpg1503

You are using the wrong Provisioning Profile i.e. Distribution for development. Go to Build Settings > Code Signing > Provisioning Profile and select a development profile.

您正在使用错误的配置文件,即用于开发的分发。转至 Build Settings > Code Signing > Provisioning Profile 并选择一个开发配置文件。

回答by David DUTOUR

Check the if your "Code Signing" configurations are same on "PROJECT>Build Settings" and "TARGETS>Build Settings".

检查“项目>构建设置”和“目标>构建设置”上的“代码签名”配置是否相同。

Personnally, I use for both:

就个人而言,我用于两者:

 - "Code Signing identity": iOS Developer 
 - "Provisioning Profile" : Automatic

回答by Timo

For me none of the above answers worked. I tried to remove every code signing certificate from Keychain and build the app. When I resolved all code signing related errors for my target I still had some of them in Tests target. It has been set by someone else from my team before. I just switched to iOS Developer, and the invalid entitlement error went away.

对我来说,以上答案都没有奏效。我试图从 Keychain 中删除每个代码签名证书并构建应用程序。当我解决了目标的所有代码签名相关错误时,我仍然在测试目标中发现了一些错误。它以前是由我团队中的其他人设置的。我刚切换到 iOS Developer,无效的权利错误就消失了。

回答by Vlad

Check your "Team" parameter at your targets. It should be the same for your project and tests.

检查目标的“团队”参数。对于您的项目和测试,它应该是相同的。

回答by Vinner

I was getting this problem after moving app from one account to another. I tried all the solutions given by others, those might be correct in other cases. But I fixed the problem by going File -> Workspace Settings -> Build System and choosing "Legacy Build System". I'm using XCode 10.3.

将应用程序从一个帐户移动到另一个帐户后,我遇到了这个问题。我尝试了其他人给出的所有解决方案,这些在其他情况下可能是正确的。但是我通过转到 File -> Workspace Settings -> Build System 并选择“Legacy Build System”解决了这个问题。我正在使用 XCode 10.3。

回答by Evana

I faced this problem and my problem was My Bundle Identifier and AppID was not matched. Please change your Bundle Identifier in Build Settings->Packaging like your AppID.

我遇到了这个问题,我的问题是我的捆绑标识符和 AppID 不匹配。请像您的 AppID 一样在 Build Settings->Packaging 中更改您的 Bundle Identifier。

enter image description here

在此处输入图片说明

回答by Cullen SUN

I got this error when export the ipa with App Store provisioning wronglyduring CI process. My intention was to export with Adhoc provisioning.

在 CI 过程中错误地导出带有 App Store 配置的 ipa 时出现此错误。我的目的是使用 Adhoc 配置导出。