Alex Aung
Alex Aung

Reputation: 3159

flutter Could not build the precompiled application for the device error on iPhone X

I got "Could not build the precompiled application for the device" error. I have tried

flutter clean, deleted flutter folder and download from start andeven erase the iPhone X but still got this error.

The project is just a flutter's default example project. I can run on ios simulator. It is only happening on my iPhone X (ios 15.1).

Xcode build done.                                            5.2s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **


Xcode's output:
↳

Failed to package /Users/aungmyooo/Development/iostester.
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in parallel
note: Removed stale file
'/Users/aungmyooo/Library/Developer/Xcode/DerivedData/Runner-dfrzocazpcgovsg
ombceeuyyznfv/Build/Products/Debug-iphoneos/Runner.app'

Could not build the precompiled application for the device.

Error launching application on iPhone.

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.8.0, on macOS 12.0.1 21A559 darwin-x64, locale
en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.63.0)
[✓] Connected device (3 available)

• No issues found!

Upvotes: 2

Views: 5230

Answers (1)

Alex Aung
Alex Aung

Reputation: 3159

I fixed it as follow. In case someone need it.

  1. Open Keychain Access
  2. Select login, and click Certificates
  3. Double click Apple Worldwide Developer Relations Certificate Authority
  4. Open trust section, and set to "Use System Defaults" from "Always Trust"
  5. Clean the build folder and run

Upvotes: 2

Related Questions