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

Issue

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

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

  • Like this

  • 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

  • Keychain Access Menu

  • 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.

Answered By – SwiftCODA

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published