IOS No signing certificate matching with a private key was found.
When updating an iOS app on the App Store, it's common to encounter certificate expiration issues. In such cases, you may decide to delete all certificates and provisioning profiles to start fresh. However, during this process, you might come across the error message "No signing certificate matching with a private key was found." This blog post will guide you through the steps to resolve this issue and successfully update your app on the App Store.
🎯 Explanation and Steps:
Expired Certificates Cleanup:
Visit the Apple Developer portal (https://developer.apple.com/account/ios/certificate/) and navigate to the Certificates section.
Remove all expired certificates by selecting them and clicking the "Delete" button.
Similarly, delete the provisioning profiles from the "~/Library/MobileDevice/Provisioning Profiles" directory.
To ensure a clean build, option-click on "Product" in Xcode and select "Clean Build Folder."
Requesting a New Certificate:
Access the Keychain Access application and navigate to "Certificate Assistant" and choose "Request a Certificate from Certificate Authority..."
Fill in your user email (matching your Apple ID) and your first and last name for the Common Name field.
Select the "Saved to disk" radio button, and save the generated "CertificateSigningRequest.certSigningRequest" file to the Downloads folder.
Uploading the Certificate Signing Request:
Return to the Apple Developer portal and go to the Certificates section.
Click the "+" button and select "iOS, tvOS, watchOS" from the combo list.
Choose the "App Store and Ad Hoc" radio button and click "Continue."
Upload the "CertificateSigningRequest.certSigningRequest" file by clicking "Choose File..." and then "Continue."
Downloading the Distribution Certificate:
After processing, the portal will present the "Your certificate is ready." page.
Download the "ios_distribution.cer" file to the Downloads folder and click "Done."
Double-click the downloaded "ios_distribution.cer" file to add it to the Keychain Access application.
Creating a Provisioning Profile:
Navigate to the Provisioning Profiles section in the Apple Developer portal.
Click the "+" button to create a new provisioning profile.
Choose the "Distribution - App Store" radio button and click "Continue."
Select the appropriate App ID for your project and click "Continue."
Choose the iOS Distribution certificate and proceed by clicking "Continue."
Provide a profile name such as "My App Name Provisioning Profile" and click "Continue."
Download the "My_app_name_Provisioning_Profile.mobileprovision" file.
Configuring Signing in Xcode:
Open your Xcode project and navigate to the Project - Targets window.
Check the "Automatically manage signing" checkbox and select your team name.
Uncheck the "Automatically manage signing" checkbox to manually configure signing.
Importing Provisioning Profiles:
Under Signing for Debug and Release, select the "Provision Profile → Import Profile..." option.
Choose the "My_app_name_Provisioning_Profile.mobileprovision" file downloaded in step 5.
Verification and Troubleshooting:
If Xcode displays the message "Provisioning profile 'My App Name Provisioning Profile' doesn't include signing certificate 'iPhone Developer: My Name (XUM88H55M8)'," perform the following checks:
Ensure that the certificate is present in the Keychain Access application and associated with the correct private key.
Double-check that the imported provisioning profile matches the corresponding certificate.
Verify that the bundle identifier in the provisioning profile matches the one in your Xcode project.
By following these steps, you can resolve the "No signing certificate matching with a private key was found" issue and successfully update your iOS app on the App Store. It's essential to ensure the correct configuration of certificates, provisioning profiles, and signing settings in Xcode to avoid such errors during the app submission process.