xcode 证书中的 Bundle ID 与您输入的 Bundle ID 不匹配
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/41945943/
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
The Bundle ID in the certificate does not match the Bundle ID you entered
提问by waseefakhtar
My Bundle ID of the certificate does not match the Bundle ID entered in the Firebase console and when I try to upload the certificate for Cloud Messaging. I get the error:
我的证书捆绑 ID 与在 Firebase 控制台中输入的捆绑 ID 不匹配,并且当我尝试上传云消息传递证书时。我收到错误:
The Bundle ID in the certificate does not match the Bundle ID you entered.
证书中的 Bundle ID 与您输入的 Bundle ID 不匹配。
My question is, what'd be the best way to match the Bundle IDs of my project in Xcode, Apple Developer Portal, and Firebase Console? Do I create a new app in iTunes Connect and then generate new certificates? Can I change Bundle IDs in Firebase Console or Apple Developer Portal? Or Can I simply create new certificates with the matching bundle IDs as it is in my Firebase Console without having to create a new app in iTunes Connect?
我的问题是,在 Xcode、Apple Developer Portal 和 Firebase Console 中匹配我的项目的 Bundle ID 的最佳方法是什么?我是否在 iTunes Connect 中创建新应用程序,然后生成新证书?我可以在 Firebase 控制台或 Apple Developer Portal 中更改 Bundle ID 吗?或者我是否可以简单地创建具有匹配包 ID 的新证书,就像在我的 Firebase 控制台中一样,而不必在 iTunes Connect 中创建新应用程序?
回答by bobtune
The Firebase documentation regarding certificatesis misleading. In the section Configure an App ID for Push Notificationsunder step 8 it tells you to expand the arrow and export the private key. Don't do this, just export the certificate itself (i.e. on the line above the private key) as a .p12
and it will work.
有关证书的Firebase 文档具有误导性。在第8 步下的为推送通知配置应用程序 ID部分中,它告诉您展开箭头并导出私钥。不要这样做,只需将证书本身(即在私钥上方的行)导出为 a 即可.p12
。
回答by wizloc
I am adding this answer as a supplement to the accepted answer. If you receive this error, it is due to your applications bundle identifier not matching what you supplied to firebase when creating your firebase application.
我将此答案添加为已接受答案的补充。如果您收到此错误,这是由于您的应用程序包标识符与您在创建 Firebase 应用程序时提供给 firebase 的标识符不匹配。
To find your firebase bundle identifier:
要查找您的 Firebase 包标识符:
Go to Firebase > Project Overview > Find your iOS application and press the 3 vertical dots on the right hand side and press Settings. You should be able to scroll down and find your Bundle ID listed
转到 Firebase > 项目概览 > 找到您的 iOS 应用程序,然后按右侧的 3 个垂直点,然后按设置。您应该能够向下滚动并找到列出的 Bundle ID
To find your apple bundle identifier:
要查找您的 Apple 捆绑包标识符:
Open Xcode, click on your top level project file and click on the General tab. Under signing, locate the Provisioning Profile and click on the 'i' icon on the right of the provided profile to view more information. Your bundle ID should be listed for both your application and for your developer account.
打开 Xcode,单击顶级项目文件,然后单击“常规”选项卡。在签名下,找到供应配置文件并单击所提供配置文件右侧的“i”图标以查看更多信息。应该为您的应用程序和开发者帐户列出您的包 ID。
Your Firebase Bundle ID and Apple Bundle ID must match. If they do not, the easiest thing to do is just create a new application in Firebase. Do not forget this will require you to download the Google-Info.plist file again. Everything else should be straightforward.
您的 Firebase Bundle ID 和 Apple Bundle ID必须匹配。如果没有,最简单的方法就是在 Firebase 中创建一个新应用程序。不要忘记这将要求您再次下载 Google-Info.plist 文件。其他一切都应该很简单。
Uploading the APNS certificate was not so straightforward on Firebase's documentation so I will write up how to do that also.
在 Firebase 的文档中上传 APNS 证书并不是那么简单,所以我也会写下如何做到这一点。
- Assuming you have generated the certificate and added it to the keychain, open Keychain Access app and right click on your APNS certificate (listed as Apple Development Push Services or similar).
- Right click and select export.
- On Firebase, go to Project Overview, find your iOS application and again press the 3 vertical dots and select Settings.
- At the top of this page, switch to the Cloud Messaging tab. You should see a section to upload your APNS certificate. You need to provide the password you created when exporting the Certificate in step 1&2.
- 假设您已生成证书并将其添加到钥匙串中,打开钥匙串访问应用程序并右键单击您的 APNS 证书(列为 Apple Development Push Services 或类似)。
- 右键单击并选择导出。
- 在 Firebase 上,转到“项目概览”,找到您的 iOS 应用程序,然后再次按垂直的 3 个点并选择“设置”。
- 在此页面的顶部,切换到 Cloud Messaging 选项卡。您应该会看到一个部分来上传您的 APNS 证书。您需要提供在步骤 1 和 2 中导出证书时创建的密码。
回答by Hemant Solanki
Follow the instructions below.
请按照以下说明操作。
Create new app in firebase console and add same bundle id for the app as you added in apple's developer account. this will fix your problem.
在 firebase 控制台中创建新应用程序,并为应用程序添加与您在苹果开发者帐户中添加的相同的包 ID。这将解决您的问题。
Or
或者
Go to firebase console and update your project bundle id same as in apple's developer account.
转到 firebase 控制台并更新与苹果开发者帐户中相同的项目包 ID。
回答by saurabh rathod
Please remove all certificates related apns from keychain.And once again install it works.
请从钥匙串中删除所有与证书相关的 apns。并再次安装它。