Flutter | Xcode | "could not build the precompiled application for the device" - ios

If you are seeing this error when building a Flutter app for a physical iOS device, here is the solution.

I had this error when building for a physical iOS device in Flutter or in the Runner.xcworkspace project. I spent probably 8-9 hours trying to remedy this error, following countless tutorials and answers on other StackOverflow questions. NOTHING worked.
Today, I coincidentally found the solution (in my case) and it may be the one for you if you're experiencing this error since Apple changed their Developer Relations Intermediate Certificate.
Open Keychain Access, select login on the left pane, select Certificates at the top, search apple, delete all:
Apple Distribution certificates
Apple Development certificates
Apple Worldwide Developer Relations Certification Authority certificates
(DO NOT DELETE your Apple Push Services certificates
Click this to download the new Apple Worldwide Developer Relations Certification Authority certificate.
Click it to add it to your Keychain.
In Keychain Access, at the top, go to Keychain Access > Certificate Assistant > Request a Certificate From a Certificate Authority
Type in your email (most likely your Apple ID).
Select Save to Disk and choose your Downloads folder.
Go to developer.apple.com.
Click Account, sign in with your Apple ID / Developer Account.
Click Certificates, IDs & Profiles.
Again, revoke any Development/Distribution certificates.
Click the plus icon, select Apple Development
Upload the signing request you just made.
Download the certificate.
Click the certificate to add it to your Keychain.
Repeat the bold steps for the Apple Distribution option.
Open your Xcode workspace.
Click your project, click your Target, click Signing & Capabilities
If you see a red error below your Apple ID, click the button to resolve it.
You should then be good to go!
I hope this helped you.

Related

Issue with Provisioning Profile

I have a app which works fine while running in device without utilizing "Provisioning Profile" of developer certificate but while trying to create a .ipa file with "Provisioning profile"it fails to create.
It gives the error "Failed to locate or generate matching signing assets". Please check the Image 1 showing this error.
To utilize the profile to install an app for client, We have selected the developer certificate, but it throws an error. Since Both the certificates (developer and Enterprise) is issued on the name of one person only.Please find the Image 2 and 3 showing the error.
We want to know what exactly the issue behind this.
If you want to archive your app then you have to create iOS Distribution certificate not development certificate and then after create AdHoc or Distribution provisioning profile and then try to archive app again.
I hope this will help you.
First Check the PMCTests targets
Click on projects PMCTests check bundle identifier and provisioning profile then check for Apple Worldwide Developer Relations Certification Authority in keychain
Apparently, I was having the same issue as this question, So I hope this will fix your problem! Download Apple Worldwide Developer Relations Certification Authority (WWDR) certificate, re add it to the keychain! and delete previouse one from keychain.
Here is the link to download the certificate :
https://developer.apple.com/certificationauthority/AppleWWDRCA.cer
First of all Check if Apple world wide Developer relations certification authority is expired,follow the below steps & if you already installed it then move to next paragraph.
Download https://developer.apple.com/certificationauthority/AppleWWDRCA.cer
and double-click to install to Keychain.
Select "View" -> "Show Expired Certificates" in Keychain app.
Remove Apple Worldwide Developer Relations Certificate Authority certificates from "login" tab and "System" tab in Keychain app.
Ensure the new downloaded cert is in both login and system Default to only system tab will still give error.**
If everything is correct as per first section,
Generate AdHoc Distribution provisioning profile
Download and double click on it.
Select that profile on build settings & then try to Archieve, it will work.

Uploading archive error: "Missing iOS Distribution signing identity for ..."

I'm trying to upload my iOS app archive to iTunes Connect using Xcode, but when I click "Upload to App Store" I get the error:
Xcode attempted to locate or generate matching signing assets and
failed to do so because of the following issues. Missing iOS
Distribution signing identity for _____. Xcode can request one for
you.
I'm really confused, because I had just successfully uploaded an archive for the same app about 2 hours earlier, and then I needed to make one simple fix and then needed to reupload the archive, and now I'm getting this error. I did not touch anything else.
I've done everything that I can think of to try fixing the problem, I restarted Xcode, my computer, went to Xcode preferences to click 'Download All' on the provisioning profiles, clicked "Reset" on the iOS Distribution on the same page, downloaded again the iOS distribution profile from the member center, went to the code signing settings in my app's build settings and manually set the release signing identity to the iOS distribution profile, and rearchived several times.
Update: Turns out it's due to the WWDRCA expiring today: https://developer.apple.com/support/certificates/expiration/
There are a lot of other people experiencing the same issue. I was able to temporarily bypass the issue by changing the date on my computer back 1 day.
The issue is because the Apple WWDRCA expired today (Feb 14, 2016): https://developer.apple.com/support/certificates/expiration/
Open Keychain Access, and in the menu, click View -> Show Expired Certificates. Then, delete the expired Apple Worldwide Developer Relations Certificate Authority from both the login and System Keychains. Install the renewed certificate from Apple by downloading from https://developer.apple.com/certificationauthority/AppleWWDRCA.cer and then opening it.
Also, you might need to restart Xcode to reflect the changes. Then, clean and build your project then re-try generating your archive.
Here's statement from Apple.
Thanks for bringing this to the attention of the community and apologies for the issues you’ve been having. This issue stems from having a copy of the expired WWDR Intermediate certificate in both your System and Login keychains. To resolve the issue, you should first download and install the new WWDR intermediate certificate (by double-clicking on the file). Next, in the Keychain Access application, select the System keychain. Make sure to select “Show Expired Certificates” in the View menu and then delete the expired version of the Apple Worldwide Developer Relations Certificate Authority Intermediate certificate (expired on February 14, 2016). Your certificates should now appear as valid in Keychain Access and be available to Xcode for submissions to the App Store.
https://forums.developer.apple.com/thread/37208
Download https://developer.apple.com/certificationauthority/AppleWWDRCA.cer
and double-click to install to Keychain.
Select "View" -> "Show Expired Certificates" in Keychain app.
Delete Apple Worldwide Developer Relations Certificate Authority certificates from "login" tab and "System" tab in Keychain app.
Edited by :Jeremy Molayem Ensure the new downloaded cert is in both login and system Default to only system tab will still give error.**
Download https://developer.apple.com/certificationauthority/AppleWWDRCA.cer
Double-click to install it in your Keychain.
Then from Keychain, Select View -> "Show Expired Certificates" in Keychain app.
It will list all the expired certificates.
Delete "Apple Worldwide Developer Relations Certificate Authority
certificates" from "login" tab
And also delete it from "System" tab.
Restart your Mac
Now your system is ready to upload the App
This answer below is the only one that works. Please mark it as the solution
The issue is because the Apple WWDRCA expired today (Feb 14, 2016): https://developer.apple.com/support/certificates/expiration/
Open Keychain Access, and in the menu, click View -> Show Expired Certificates. Then, delete the expired Apple Worldwide Developer Relations Certificate Authority from both the login and System Keychains. Install the renewed certificate from Apple by downloading from https://developer.apple.com/certificationauthority/AppleWWDRCA.cer and then opening it.
I had the same problem and was able to fix it by installing this "Apple World Wide Developer Relations Certificate Authority" certificate in my keychain: link
As odd as it may seem, setting the computer's date back one day works.
I was having this exact same problem and I tried literally everything, I deleted expired certificates on keychain, downloaded the new WWDRCA as others have posted a link to. Edited and re-download my provisioning profile. and then quit xcode opened it back up and cleaned but nothing worked. The only thing that did work for me was changing the date on my Mac to Jan 1st 2016 and it uploaded perfectly! This obviously isn't a permanent fix but I'm on a deadline and it needed to get uploaded asap so hopefully this helps someone in a similar situation.
If you have renewed your account developer, go to Provisioning Profiles site and renew in developer profile.
I faced the same issue and the only thing that worked for me was setting the computer's date backwards as suggested by other responders, I tried downloading the "Apple World Wide Developer Relations Certificate Authority" but no luck.

missing ios development signing identity for (null)

when i try to generate ipa file, i am getting this error. Not able to solve.Please help me out to resolve this error:
i have own account , in my key chain access its shoeing like this :
i am not using new mac, i have already created ipa .Day before itself i have created. But today not able to do. i have .cer profile too.Its valid
Here's statement from Apple.
Thanks for bringing this to the attention of the community and apologies for the issues you’ve been having. This issue stems from having a copy of the expired WWDR Intermediate certificate in both your System and Login keychains. To resolve the issue, you should first download and install the new WWDR intermediate certificate (by double-clicking on the file). Next, in the Keychain Access application, select the System keychain. Make sure to select “Show Expired Certificates” in the View menu and then delete the expired version of the Apple Worldwide Developer Relations Certificate Authority Intermediate certificate (expired on February 14, 2016). Your certificates should now appear as valid in Keychain Access and be available to Xcode for submissions to the App Store.
https://forums.developer.apple.com/thread/37208
Download https://developer.apple.com/certificationauthority/AppleWWDRCA.cer
and double-click to install to Keychain.
Select "View" -> "Show Expired Certificates" in Keychain app.
Remove Apple Worldwide Developer Relations Certificate Authority certificates from "login" tab and "System" tab in Keychain app.
Ensure the new downloaded cert is in both login and system Default to only system tab will still give error.**
Open Keychain
Search for
Apple world wide Developer relations certification authority
Delete this.
Download https://developer.apple.com/certificationauthority/AppleWWDRCA.cer and add it to Keychain access > certificates
Worked for me.
If you still have this issue even after deleting and installing the new WWDRCA, make sure you deleted it as well in you system tab certificates
I struggled with this issue for a while so wanted to post what I found in case others run into a similar issue. I ran into the above issue after revoking my certificate while trying to export my build from a friend's machine. I found the best support by going step by step through this link:
https://developer.apple.com/library/content/documentation/IDEs/Conceptual/AppDistributionGuide/DistributingApplicationsOutside/DistributingApplicationsOutside.html
I would recommend following the steps in this link for anyone uploading a build to the Mac app store or exporting a Developer ID Signed Mac application.
There is a certificate called "Developer ID Certification Authority", this seems to be the one I was missing, and which caused the most trouble.
Another interesting thing to note is that the 10 digit letter/number ID for your Team/Distribution profile will be different than the ID for your developer profile. This should not throw you off, these two profiles work together.
Another good thing to know is that at the top of developer.apple.com there is a non-obvious drop down menu that lets you switch between iOS, tvOS, watchOS profiles and MacOS X profiles.
Another non-obvious UX issue when dealing with certificates is the system tab within Keychain Access. If you read that you should delete or change a property both within Login and within system, when they write system, they are referring to the system tab, which can be accessed within Key Chain access and can be seen at the bottom of this image:
This link is also helpful for certificate trouble shooting:
https://developer.apple.com/library/content/documentation/IDEs/Conceptual/AppDistributionGuide/Troubleshooting/Troubleshooting.html#//apple_ref/doc/uid/TP40012582-CH5-SW11
But mainly just go through the steps in the first link given for exporting a Mac App with Developer ID Signing.
The issue is because the Apple Intermediate Certificate (Apple WWDR CA) is expired yesterday, 14 February 2016, on Saint Valentine. https://developer.apple.com/support/certificates/expiration/
1- Update the system date to 13 February 2016. (IT’S WORKING FOR ME)
or
2- Open Keychain Access, and in the menu, click View -> Show Expired Certificates. Then, delete the expired Apple Worldwide Developer Relations Certificate Authority from both the login and System Keychains. Install the renewed certificate from Apple by downloading from https://developer.apple.com/certificationauthority/AppleWWDRCA.cer and then opening it.
or
3- Follow the steps 1 and 2; only later change the system date to the current date.

XCode export app, wildcard error

I am developing a Swift iOS app for in-house distribution and I am having trouble exporting the app - I get: "Wildcard App IDs can not be used to create In House provisioning profiles. Please use an Explicit App ID."
In the Member Center, I have created an explicit App ID:
In the Member Center, I have also created an iOS Provisioning Profile for Distribution:
In XCode, I have downloaded the distribution provisioning profile (under preferences > Accounts):
This is a Swift iOS app (my first) and I am trying to export the app (.ipa & .plist file), so that I can deploy it from an Intranet site. Note: I do not have an MDM (nor do I want to purchase one at this time). Xcode version: 7.2.1.
What am I missing?
Edit 2/15/2016: This SO Post is about a similar issue, but the steps outlined there did not resolve the issue for me.
I faced the same problem and almost spent one day to solve the problem.
When I encountered the problem, I thought it was an error related with invalid distribution certificate or provisioning profile. I renewed certificates and all other stuff. Nothing worked! Neither certificates nor provisioning profiles were the root cause.
I have seen an announcement on Apple Developer page. Apple's WWDR Certificate was expiring and newest one available on that page. I updated that certificate and it worked!
Steps you should follow:
Open Keychain Access and remove expired Apple Worldwide Developer Relations Certification Authority from certificates.
Download new certificate as suggested.
Be sure that Apple Worldwide Developer Relations Certification Authority is located under Systems keychain, not in login.
Open XCode (If already, close and then open)
Clean your project.
Select your valid signing certificates and provisioning profiles. (You don't need to refresh your certificates or profiles as annoucement suggested)
Hit Archive button!
Hope this may help someone else.

Xcode 7 error: "Missing iOS Distribution signing identity for ..."

I tried to upload my App to iTunes Connect resp. AppStore and got the following error:
Failed to locate or generate matching signing assets
Xcode attempted to locate or generate matching signing assets and failed to do so because of the following issues.
Missing iOS Distribution signing identity for ...
Xcode can request one for you.
Before I set up a new development machine, exported the developer accounts via Xcode 7 from the old to the new machine.
What can I do to fix this?
From Apple -
Thanks for bringing this to the attention of the community and
apologies for the issues you’ve been having. This issue stems from
having a copy of the expired WWDR Intermediate certificate in both
your System and Login keychains. To resolve the issue, you should
first download and install the new WWDR intermediate certificate (by
double-clicking on the file). Next, in the Keychain Access
application, select the System keychain. Make sure to select “Show
Expired Certificates” in the View menu and then delete the expired
version of the Apple Worldwide Developer Relations Certificate
Authority Intermediate certificate (expired on February 14, 2016).
Your certificates should now appear as valid in Keychain Access and be
available to Xcode for submissions to the App Store.
As noted in a comment below, the expired certificate also needs to be removed from the login section, as well:
To all that cannot get it working despite the instructions... There
are two expired WWDR certs. One is in login keychain, and the other
one is in the System. You have to delete both of them in order to make
things working
I also faced the same issue today. The following steps fixed my issue.
Download https://developer.apple.com/certificationauthority/AppleWWDRCA.cer
Double-click to install to Keychain.
Then in Keychain, Select View -> "Show Expired Certificates" in Keychain app.
It will list all the expired certifcates.
Delete "Apple Worldwide Developer Relations Certificate Authority certificates" from "login" tab
And also delete it from "System" tab.
Now you are ready go.
I kept running into the issue and saw that all my certs were invalidated -- oh no!
It turns out I never deleted the expired cert. It was not showing up for me, until I selected from Keychain Access application:
View->Show Expired Certificates
then
System->All Items
will finally display that gnarly expired cert. Delete that and retry from XCode will pick up the new valid certs.
Just make sure you search "All Items" in the Keychain Access app. The invalidated certs are a result of pointing to the expired certificate that has not been deleted yet.
The below process will solve the problem,
1: Open KeyChain access, and Delete "Apple world wide Developer relations certification authority" (Which expires on 14th Feb 2016) from both "Login" and "System" sections. If you can't find it, use “Show Expired Certificates” in the 'View' menu.
2: Now download https://developer.apple.com/certificationauthority/AppleWWDRCA.cer and double click the certificate to add it to Keychain access > certificates (which expires on 8th Feb 2023).
Now the valid status of the certificates should turn green like below.
Once check the status.
Apple has made following changes so download new certificate developer.apple.com
renewed certificate and place it as below screen shots .In the keychain as below screen shots click on system and then certificate. Delete the expired certificate . Then drag and drop the AppleWWDRCA.cer that you downloaded from above link
Apple Worldwide Developer Relations Intermediate Certificate Expiration
To help protect customers and developers, we require that all third
party apps, passes for Apple Wallet, Safari Extensions, Safari Push
Notifications, and App Store purchase receipts are signed by a trusted
certificate authority. The Apple Worldwide Developer Relations
Certificate Authority issues the certificates you use to sign your
software for Apple devices, allowing our systems to confirm that your
software is delivered to users as intended and has not been modified.
The Apple Worldwide Developer Relations Certification Intermediate
Certificate expires soon and we've issued a renewed certificate that
must be included when signing all new Apple Wallet Passes, push
packages for Safari Push Notifications, and Safari Extensions starting
February 14, 2016.
While most developers and users will not be affected by the
certificate change, we recommend that all developers download and
install the renewed certificate on their development systems and
servers as a best practice. All apps will remain available on the App
Store for iOS, Mac, and Apple TV.
Since different methods can be used for validating receipts and
delivering remote notifications, we recommend that you test your
services to ensure no implementation-specific issues exist. Your apps
may experience receipt verification failure if the receipt checking
code makes incorrect assumptions about the certificate. Make sure that
your code adheres to the Receipt Validation Programming Guide and
resolve all receipt validation issues before February 14, 2016.
After searching for a while I found out that it is not sufficient to export the developer accounts from Xcode and import these on the new machine, again via Xcode.
Additionally I needed to copy the Certficate named "Apple World Wide Developer Relations Certificate Authority" from the keychain of the former development machine to the keychain of the new one.
This solved the problem for me.
I imported the new Apple WWDR Certificate that expires in 2023, but I was still getting problems and my developer certificates were showing the invalid issuer error.
In keychain access, go to View -> Show Expired Certificates, then in your login keychain highlight the expired WWDR Certificate and delete it.
I also had the same expired certificate in my System keychain, so I deleted it from there too.(Important)
After deleting the expired cert from the login and System keychains, I was able to build for Distribution again.
I removed old AppleWWDRCA, downloaded and installed AppleWWDRCA, but problem remained. I also, checked my distribution and development certificates from Keychain Access, and see below error;
"This certificate has an invalid issuer."
Then,
I revoked both development and distribution certificates on member center.
Re-created CSR file and add development and distribution certificates from zero, downloaded them, and installed.
This fixed certificate problem.
Since old certificates revoked, existing provisioning profiles become invalid. To fix this;
On member center, opened provisioning profiles.
Opened profile detail by clicking "Edit", checked certificate from the list, and clicked "Generate" button.
Downloaded and installed both development and distribution profiles.
I hope this helps.
My answer was different and came along with the message:
resource fork, Finder information, or similar detritus not allowed
The solution was to do with generated graphics:
Code Sign Error in macOS Sierra Xcode 8 : resource fork, Finder information, or similar detritus not allowed
Don't forget to also install the iOS cert for your Apple Developer Account.
Make Sure that in Project Navigator > Signing > Team , A team name must need be selected.

Resources