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

Time:05-27

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

CodePudding user response:

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

  • Related