Picard
Picard

Reputation: 4112

Flutter: Failed to build iOS app. Could not build the precompiled application for the device

This is probably a stupid question but those errors are really cryptic to me and I'm only starting with iOS/Flutter development.

OK, all was working fine - I was able to flutter run --release my app to my developer iPhone but today I got an error from flutter like:

Failed to build iOS app
Could not build the precompiled application for the device.

Building a deployable iOS app requires a selected Development Team with a 
Provisioning Profile. Please ensure that a Development Team is selected by:
  1- Open the Flutter project's Xcode target with
       open ios/Runner.xcworkspace
  2- Select the 'Runner' project in the navigator then the 'Runner' target
     in the project settings
  3- Make sure a 'Development Team' is selected under Signing & Capabilities > Team. 
     You may need to:
         - Log in with your Apple ID in Xcode first
         - Ensure you have a valid unique Bundle ID
         - Register your device with your Apple Developer Account
         - Let Xcode automatically provision a profile for your app
  4- Build or run your project again

For more information, please visit:
  https://flutter.dev/docs/get-started/install/macos#deploy-to-ios-devices

Or run on an iOS simulator without code signing

The only thing that changed from yesterday is that I updated my iPhone's iOS from 16.2 to 16.6 and now I wonder - is this error caused by:

So about the versions I have:

Checking with the Xcode compatibility page: Xcode 14.2 has:

So since my Xcode build can target up to iOS 16.2 this mean that my iPhone 16.6 cannot run it? If so, then the only way to make it work is that I need to upgrade my macOS to Ventura 13.4 which supports Xcode 15 which targets iOS 12-17?

Upvotes: 0

Views: 2343

Answers (1)

Picard
Picard

Reputation: 4112

So I found out the solution.

Connecting and disconnecting phone with Xcode didn't do much so I ended up updating my macOS to 13.5.1, Xcode to 14.3.1 and that didn't changed a thing (Xcode 15.x that I was hoping for appeared to be still in beta - but you can't tell that straight from the "Minimum requirements and supported SDKs" list).

Yeah and then in desperation I started searching through the options of the developer mode on the iPhone and yes - the first option was: "Initialise computer authorisation" - it seems like after the iOS upgrade you need to do this again.

The strange thing is that my iPhone was the whole time visible to Flutter and Xcode - it was showing in options so I thought that everything with my iPhone config is OK but is seems like it wasn't.

It is possible that the upgrade of macOS and Xcode did something too, but for sure checking first the "Initialise computer authorisation" option would be a couple of dozen times faster :(

Upvotes: 1

Related Questions