xcode 签名者无效错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1857414/
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-09-09 03:13:20  来源:igfitidea点击:

Signer not valid error

iphonexcodeitunesapp-store-connectadhoc

提问by 4thSpace

I've created an ad hoc build of my app and would like another person to install it. I have their device ID (two actually) in the provisioning profile. My certificate is the same for ad hoc and app store provisioning. The certificate is valid in keychain. I've selected the ad hoc profile in Xcode for this build, which is linked to the distribution certificate.

我已经创建了我的应用程序的临时版本,并希望其他人安装它。我在配置文件中有他们的设备 ID(实际上是两个)。我的证书对于临时和应用商店配置是相同的。证书在钥匙串中有效。我在 Xcode 中为此构建选择了临时配置文件,该配置文件链接到分发证书。

I send the user the provisioning file and .app file. They drop both into iTunes and sync then get this error on both devices:

我向用户发送了配置文件和 .app 文件。他们将两者都放入 iTunes 并同步,然后在两台设备上都出现此错误:

The application "myapp" was not installed on the iPhone "user's iPhone" because the signer is not valid.

I've removed all profiles from my iPhone, dropped the above two files into iTunes, sync'd and installed the app successfully. I can't get it to repro for me. I need to repro this problem locally to figure out the issue. Any ideas how that can be done?

我已经从我的 iPhone 中删除了所有配置文件,将上述两个文件放入 iTunes,同步并成功安装了该应用程序。我无法让它为我重现。我需要在本地重现这个问题以找出问题所在。任何想法如何做到这一点?

回答by zaph

Did you add Entitlements? Put the signing at the Target level, not the Project level? Select the Ad Hoc profile? DO a clean prior to the build? Select the Ad Hoc Device foe the build?

您是否添加了权限?将签名放在目标级别,而不是项目级别?选择 Ad Hoc 配置文件?在构建之前进行清洁吗?选择构建的 Ad Hoc 设备?

The best bet is to follow Apple's documentation exactly, get your build settings to exactlymatch Apple's.

最好的办法是遵循苹果的文件完全相同,让您的构建设置,以准确地匹配苹果。

回答by cipherz

It's a good idea to check the imbedded.mobileprovision file that comes bundled in the .app file to make sure that the UID is in there. Just do the following:

检查捆绑在 .app 文件中的 embedded.mobileprovision 文件以确保 UID 在那里是一个好主意。只需执行以下操作:

  1. unzip ProblemApp.ipa
  2. cd Payload/ProblemApp.app
  3. pico imbedded.mobileprovision
  1. 解压问题App.ipa
  2. cd Payload/ProblemApp.app
  3. pico embedded.mobileprovision

Look for the UID of your device within this file. If it's not there then it's probably not added to the provisioning file within the portal.

在此文件中查找您设备的 UID。如果它不存在,那么它可能不会添加到门户内的配置文件中。

回答by daidai

From the docs:

从文档:

Building an app for Ad Hoc distribution is similar to building an app for App Store distribution, with an exception of two additional steps. First, you need to create an Ad Hoc Distribution Provisioning profile and add the UDIDs of the iOS devices that you want to distribute to using the iPhone Developer Program Provisioning Portal. Second, you need to create a code-signing Entitlements file. For information about how to create an Entitlements file read the Managing Application Entitlements section of the iOS Development Guide.

为 Ad Hoc 分发构建应用程序类似于为 App Store 分发构建应用程序,但有两个额外的步骤。首先,您需要创建一个 Ad Hoc Distribution Provisioning 配置文件,并使用 iPhone Developer Program Provisioning Portal 添加要分发到的 iOS 设备的 UDID。其次,您需要创建一个代码签名权利文件。有关如何创建权利文件的信息,请阅读 iOS 开发指南的管理应用程序权利部分。



Managing Application Entitlements

iOS provides access to special resources and capabilities—such as whether your application can be debugged—through properties called entitlements. To specify entitlement information in your application, you add an entitlement property-list file containing entitlement definitions (key/value pairs) to your project. When you build your application, Xcode copies the file to the generated application bundle.

To add an entitlements property-list file to your project:

In the Groups & Files list, select the Resources group. Choose File > New File. Choose the iOS > Code Signing > Entitlements template. Name the file Entitlements.plist. (You can use any name; just ensure it matches the value of the Code Signing Entitlements build setting, as explained later in this section.) Set the type of the property-list file to iPhone Entitlements. With the file selected in the text editor, choose View > Property List Type > iPhone Entitlements plist.

Add your entitlement entries to the file. For each entitlement property you need to define:

Click the Add Child or Add Sibling buttons to the right of the selected row. The Add Child button has three lines depicting a hierarchy, the Add Sibling button has a plus (+) sign on it. Choose the entitlement property from the pop-up menu that appears. If the entitlement you need to add doesn't appear in the menu, choose View > Property List Type > Default for File Type. Then enter the entitlement-key name and type.

Enter the value for the property. Set the Code Signing Entitlements build setting for the target to the name of the newly added entitlements property-list file.

管理应用程序权限

iOS 通过称为权利的属性提供对特殊资源和功能的访问,例如您的应用程序是否可以调试。要在应用程序中指定权利信息,请将包含权利定义(键/值对)的权利属性列表文件添加到项目中。构建应用程序时,Xcode 会将文件复制到生成的应用程序包中。

要将权利属性列表文件添加到您的项目:

在组和文件列表中,选择资源组。选择“文件”>“新建文件”。选择 iOS > 代码签名 > 权利模板。将文件命名为 Entitlements.plist。(您可以使用任何名称;只要确保它与 Code Signing Entitlements 构建设置的值相匹配,如本节后面所述。)将属性列表文件的类型设置为 iPhone Entitlements。在文本编辑器中选择文件后,选择“视图”>“属性列表类型”>“iPhone 权利 plist”。

将您的权利条目添加到文件中。对于每个权利属性,您需要定义:

单击所选行右侧的添加子项或添加兄弟项按钮。Add Child 按钮有三行描述层次结构,Add Sibling 按钮上有一个加号 (+)。从出现的弹出菜单中选择权利属性。如果您需要添加的权利没有出现在菜单中,请选择“视图”>“属性列表类型”>“文件类型的默认值”。然后输入授权密钥名称和类型。

输入属性的值。将目标的代码签名权利构建设置设置为新添加的权利属性列表文件的名称。



Once you have created your Entitlements file and added it to your Code Signing Entitlements build setting, open the Entitlements file and add or edit the get-task-allow key and set it to false.

In addition to compressing your .app bundle to distribute your Ad Hoc build to testers, etc. it is recommended that you also compress the provisioning profile before distributing because certain email clients and servers may corrupt the provisioning profile.

For information about Ad Hoc distribution please read the Publishing Applications for Testing section in the iOS Development Guide.

创建权利文件并将其添加到代码签名权利构建设置后,打开权利文件并添加或编辑 get-task-allow 键并将其设置为 false。

除了压缩您的 .app 包以将您的 Ad Hoc 构建分发给测试人员等之外,还建议您在分发之前压缩配置文件,因为某些电子邮件客户端和服务器可能会损坏配置文件。

有关 Ad Hoc 分发的信息,请阅读 iOS 开发指南中的发布应用程序进行测试部分。

回答by jstr

I ran into this problem recently with one tester on a recent build. It turned out that my tester had reset their iPod Touch and removed the provisioning profile in the process.

我最近在最近的构建中遇到了一个测试人员这个问题。结果是我的测试人员重置了他们的 iPod Touch 并在此过程中删除了配置文件。

Just something to consider.

只是需要考虑的事情。

回答by Josh Justice

I got this error by doing something dumber than anyone else has posted. I added new devices to the profile, but forgot to download the updated version, add it to Xcode, and point the project to it. When I set it up properly, testers were able to install the app fine.

我做了一些比其他人发布的更愚蠢的事情,从而得到了这个错误。我在配置文件中添加了新设备,但忘记下载更新版本,将其添加到 Xcode,并将项目指向它。当我正确设置它时,测试人员能够很好地安装该应用程序。

回答by lorfds

Here's another fun one.... if you have separate entitlement files for iphone and ipad, make sure you set the target for the file for each specific build...otherwise it won't show in the build and you'll get this error

这是另一个有趣的...错误

回答by Hyman Jansen

I arrived here because I had the same problem as the OP. It indeed turned out that I didn't have the UDID in the entitlements file, even though I'm sure I used refresh in the XCode organizer. Another refresh made no difference.

我来到这里是因为我遇到了与 OP 相同的问题。事实证明,我在权利文件中没有 UDID,即使我确定我在 XCode 管理器中使用了刷新。再次刷新没有任何区别。

In the end I removed all provisioning profiles and thendid a refresh. Things now work.

最后,我删除了所有配置文件,然后进行了刷新。现在一切正常。

I have no idea whether this is a glitch in my setup, or an operator error. But just in case anyone else finds themselves in this situation: it may pay to remove your provisioning profiles and then do a refresh.

我不知道这是我设置中的故障,还是操作员错误。但以防万一其他人发现自己处于这种情况:删除您的配置文件然后进行刷新可能是值得的。

回答by beernik

I had the same problem as the OP too. Dumb mistake: I accidentally dropped the last two digits off the device I was attempting to ad hoc distribute to when I registered it as a device.

我也遇到了和 OP 一样的问题。愚蠢的错误:当我将它注册为设备时,我不小心将最后两位数字从我试图临时分发的设备上删除了。

回答by shyla

I got same problem two times ( xcode 4.2 ios 5)

我两次遇到同样的问题 ( xcode 4.2 ios 5)

1st,time i forgot to add armv6 in architecture

第一,我忘了在架构中添加 armv6

2nd, time i have created to many provisioning files with same developer id that i should delete others key-chain according to use of bundle identifier ...and i mistakenly deleted valid and used other kechain

第二,当我创建了许多具有相同开发人员 ID 的配置文件时,我应该根据捆绑标识符的使用删除其他钥匙串……我错误地删除了有效并使用了其他钥匙串

回答by drfence

This wouldn't work for me with an iphone 3G running IOS 3.1.3. I verified that the distribution profile wasn't on the phone by looking at settings->general ( there was no profile option listed).

对于运行 IOS 3.1.3 的 iphone 3G,这对我不起作用。我通过查看设置-> 常规(没有列出配置文件选项)验证了分发配置文件不在手机上。

I then installed the iphone config utility:

然后我安装了 iphone 配置实用程序:

http://support.apple.com/kb/DL851

http://support.apple.com/kb/DL851

Then:

然后:

  1. run iphone config
  2. drag and drop embedded.mobileprovision file to app
  3. click device on left side
  4. click "provisioning profiles" tab
  5. click on the profile and then click the "install" button
  1. 运行iphone配置
  2. 将embedded.mobileprovision 文件拖放到应用程序
  3. 单击左侧的设备
  4. 单击“配置文件”选项卡
  5. 单击配置文件,然后单击“安装”按钮

Then the app installed just fine.

然后应用程序安装得很好。