简体   繁体   English

应用程序ID和捆绑包标识符:供应配置文件问题

[英]App ID & bundle identifier: provisioning profile issues

I'm working on an Ionic 3 project and just now getting around to setting up and testing notifications. 我正在做一个Ionic 3项目,现在正忙于设置和测试通知。 I don't have prior native iOS development experience, so I've been following a few guides on how to get all the proper certificates, provisioning profiles, and other setup done correctly. 我没有原生的iOS开发经验,因此我一直在遵循一些指南,了解如何正确完成所有正确的证书,配置文件和其他设置。

I have an Apple Developer account which I've added to Xcode and have so far been letting Xcode (version 8.3.3) handle signing automatically. 我有一个Apple Developer帐户,我已经将其添加到Xcode,并且到目前为止,它一直在让Xcode(版本8.3.3)自动处理签名。

I'm implementing notifications as part of Mixpanel integration, so I've been following this guide: https://mixpanel.com/help/reference/ios-push-notifications . 我正在将通知实施为Mixpanel集成的一部分,因此我一直在遵循此指南: https : //mixpanel.com/help/reference/ios-push-notifications This guide is pretty complete- it walks the user through creating an app ID, adding push, creating & signing the required certs, creating a provisioning profile, and finally uploading those to Mixpanel. 本指南非常完整-指导用户创建应用ID,添加推送,创建和签名所需的证书,创建配置文件,最后将这些文件上传到Mixpanel。 The entire process went fine. 整个过程进行得很好。

When I connected my device in order to try and test push notifications, I started having issues building- I hadn't added the push notification Capability in Xcode, so I did that- however, when I did so, I started getting an error in the code signing config that my provsioning profile didn't include that capability. 当我连接设备以尝试和测试推送通知时,我开始遇到问题-我没有在Xcode中添加推送通知功能,所以我这样做了-但是,当我这样做时,我开始遇到错误我的验证配置文件不包含该功能的代码签名配置。 Weird, because in the details of my App ID on the Apple Developer site, I see that push notifications are enabled for development. 很奇怪,因为在Apple Developer网站上我的App ID的详细信息中,我看到启用了推送通知才能进行开发。

Upon closer inspection, I think the issue is that my App ID bundle identifier (on the Apple Dev site) and the bundle identifier in Xcode don't match. 经过仔细检查,我认为问题是我的App ID捆绑包标识符(在Apple Dev网站上)和Xcode中的捆绑包标识符不匹配。 My App ID bundle identifier is: 我的应用程序ID捆绑标识符是:

<team_ID>.com.<domain>.app

But my bundle identifier in Xcode is: 但是我在Xcode中的包标识符是:

com.<domain>.app

At the time I created the App ID, I thought the <team_ID> prefix was required for the bundle identifier in the App ID setup- but I don't think that's right. 在创建应用程序ID时,我认为应用程序ID设置中的捆绑包标识符需要<team_ID>前缀-但我认为这是不对的。 I see the prefix separately in the App ID info: 我在App ID信息中分别看到前缀:

应用程式编号资讯

Was this the wrong thing to do? 这是错误的做法吗? The reason I got confused and added the team ID to my App ID bundle identifier was because my bundle identifier from Xcode ( com.<domain>.app ) wasn't allowed. 我感到困惑并把团队ID添加到我的App ID捆绑标识符中的原因是因为不允许我从Xcode( com.<domain>.app )获得捆绑标识符。 The error I got when trying to use it while creating an App ID: 创建App ID时尝试使用该错误:

创建应用ID时出错

To be clear- I have no other App IDs in the Apple Developer profile with this bundle identifier. 请注意,Apple Developer概要文件中没有具有此捆绑包标识符的其他App ID。

I know this identifier should be available because I've been using it in Xcode before today, with the same signing identity. 我知道此标识符应该可用,因为在今天之前我一直在Xcode中使用它,并且具有相同的签名身份。 Why wouldn't I be allowed to use it to create an App ID- isn't the point that the bundle ID must be the same both in that and in Xcode? 为什么不允许我使用它来创建App ID-捆绑包ID在Xcode和Xcode中都必须相同是不是要紧?

The final confusing point here (to me) is that I decided to change the bundle identifier in Xcode to match that of my App ID (to confirm that, once they matched, building would work). 最后一个让我感到困惑的点是,我决定更改Xcode中的包标识符以匹配我的App ID的标识符(以确认一旦匹配,构建就可以了)。 After I did that, Xcode seemed to accept the new bundle identifier, but I get different build errors- and if I change my signing identity, the errors that show up in the signing config don't make sense- they reference a bundle identifier that isn't the one just above in Xcode: 完成此操作后,Xcode似乎接受了新的捆绑包标识符,但是我遇到了不同的构建错误-如果更改签名身份,则在签名配置中显示的错误没有意义-它们引用了一个捆绑包标识符,不是Xcode上面的那个:

奇怪的配置错误

Specifically, why does the bundle identifier in the error not match what's set in the config at the top of the image? 具体来说,为什么错误中的包标识符不匹配图像顶部配置中的设置? I've tried restarting Xcode and this still happens. 我尝试重新启动Xcode,但这仍然会发生。 At this point, I can't even build with Xcode if I remove the push capability- I get a mysterious Apple Mach-O Linker (ID) error which doesn't turn up much when googling. 在这一点上,如果删除了推送功能,我什至无法使用Xcode进行构建-我收到了一个神秘的Apple Mach-O Linker (ID) error ,该Apple Mach-O Linker (ID) error在使用Google谷歌搜索时不会出现太多问题。

The provisioning profile you are using is configured for the bundle identifier in the error message you are receiving. 您正在使用的供应配置文件已配置为正在接收的错误消息中的捆绑包标识符。 To fix this you can either: 要解决此问题,您可以:

  • Set the bundle identifier of your app to the one you see in the error message 将应用程序的捆绑包标识符设置为您在错误消息中看到的标识符
  • Create another provisioning profile with the bundle identifier you would like to use in your app 使用您要在应用程序中使用的捆绑标识符创建另一个配置文件

You will also need to add Push Notifications to your profile. 您还需要将推送通知添加到您的个人资料。 Here are some instructions on how to do this: 以下是有关如何执行此操作的说明:

  1. Go to Certificates, Identifiers & Profiles and for Mac apps, choose OS X from the pop-up menu on the left. 转到证书,标识符和配置文件 ,对于Mac应用程序,从左侧的弹出菜单中选择OSX。
  2. Under Identifiers, select App IDs. 在“标识符”下,选择“应用程序ID”。
  3. Select the explicit App ID that matches the bundle ID. 选择与捆绑软件ID匹配的显式App ID。
  4. A green circle followed by “Enabled” appears in the Push Notifications row and the Distribution column. 在“推送通知”行和“分发”列中将出现一个绿色圆圈,后跟“已启用”。

The provided answers and comments had good information, however, the only thing that worked for me was creating a new App ID that didn't conflict with the bundle identifier I had set in Xcode. 提供的答案和评论具有很好的信息,但是,对我唯一有用的是创建一个新的App ID,该ID与我在Xcode中设置的包标识符不冲突。 I think the inclusion of my team prefix in my first App ID name played a large part in this usse, as I haven't seen that weird behavior since creating a new App ID with a normal bundle identifier. 我认为在我的第一个应用程序ID名称中包含团队前缀在此用途中起了很大作用,因为自从使用正常的捆绑包标识符创建新的应用程序ID之后,我还没有看到过奇怪的行为。

In addition to the possible solutions above, if these do not work for you or if you are getting a build error that says something like: 'resource fork, Finder information, or similar detritus not allowed' then here is the solution that worked for me: 除了上述可能的解决方案之外,如果这些解决方案对您不起作用或出现构建错误,例如:“不允许使用资源分叉,Finder信息或类似的碎屑”,那么以下是对我有用的解决方案:

A: This is a security hardening change that was introduced with iOS 10, macOS Sierra, watchOS 3, and tvOS 10. 答:这是iOS 10,macOS Sierra,watchOS 3和tvOS 10引入的一项安全性增强更改。

Code signing no longer allows any file in an app bundle to have an extended attribute containing a resource fork or Finder info. 代码签名不再允许应用程序捆绑包中的任何文件具有包含资源派生或Finder信息的扩展属性。

To see which files are causing this error, run this command in Terminal: 要查看导致此错误的文件,请在终端中运行以下命令:

$ xattr -lr $ xattr -lr

replacing with the path to your actual app bundle. 替换为实际应用捆绑包的路径。

Here's an example of this command in action: 这是此命令的一个示例:

$ xattr -lr Foo.app /Applications/Foo.app: com.apple.FinderInfo: 00000000 00 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00 |................| $ xattr -lr Foo.app /Applications/Foo.app:com.apple.FinderInfo:00000000 00 00 00 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00 | ..................... .... | You can also remove all extended attributes from your app bundle with the xattr command: 您还可以使用xattr命令从应用程序包中删除所有扩展属性:

$ xattr -cr $ xattr -cr

Note that browsing files within a bundle with Finder's Show Package Contents command can cause Finder info to be added to those files. 请注意,使用Finder的Show Package Contents命令浏览捆绑包中的文件可能会使Finder信息添加到这些文件中。 Otherwise, audit your build process to see where the extended attributes are being added. 否则,请审核您的构建过程以查看扩展属性的添加位置。

link to the original article in Apple developer library 链接到Apple开发人员库中的原始文章

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Xcode 配置文件 apple id 不匹配包标识符 - Xcode Provisioning profile apple id not matching bundle identifier 与供应配置文件不同的捆绑包标识符。 - Bundle Identifier Different from Provisioning Profile. 供应配置文件与捆绑包标识符不匹配 - Provisioning profile does not match bundle identifier 如何从配置文件中提取捆绑标识符? - How to extract the bundle identifier from a provisioning profile? 没有为您的项目的 Bundle Identifier 或您的设备找到配置文件(应用程序传输后) - No Provisioning Profile was found for your project's Bundle Identifier or your device (after app transfer) 如何将供应配置文件添加到捆绑包ID列表中 - how to add the provisioning profile into the bundle ID list 证书,应用程序ID和供应配置文件 - Certificates, App ID and Provisioning Profile 配给配置文件“ **”的应用程序ID为“ **”,该ID与捆绑包ID“ ** OneSignalNotificationServiceExtension”不匹配 - Provisioning profile “**” has app ID “**”, which does not match the bundle ID “**OneSignalNotificationServiceExtension” 代码签名错误:供应配置文件与包标识符不匹配 - Code Sign error: Provisioning profile does not match bundle identifier 应用分发设置配置文件和签名问题 - App Distribution Provisioning Profile and Signing Issues
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM