Flutter build fails on iOS physical device in Android Studio, works in Xcode

Hello,

I'm encountering an issue when trying to build and launch a Flutter app on a physical iOS device using Android Studio.

Here is the full log:

`Launching lib/main.dart on (iPhone Name) in debug mode...

Automatically signing iOS for device deployment using specified development team in Xcode project: (Project ID)

Running Xcode build...

Xcode build done. 19.7s

Failed to build iOS app

Could not build the precompiled application for the device.

Error (Xcode): Target debug_unpack_ios failed: Exception: Failed to codesign (Project Names)/build/ios/Debug-iphoneos/Flutter.framework/Flutter with identity (identity ID).

Error launching application on (iPhone Name).`

This only happens when using Android Studio. When I build the same project using Xcode, it runs fine on the same device.

Background:

I accidentally deleted all Apple accounts from Xcode recently. In Keychain Access, I had three identical certificates; I deleted the older two and kept the newest one. I suspect this may be related to provisioning or code signing, but I’m not sure how to resolve it within Android Studio. Any advice or steps to fix this would be greatly appreciated.

I created a new test project in Xcode using the iOS > App template, enabled automatic signing in Signing & Capabilities, and selected my team.
 I then tried building and installing the app on a real device, and it worked successfully.


This confirms that there are no issues with code signing or provisioning on the Apple side.


Thanks in advance!

Flutter build fails on iOS physical device in Android Studio, works in Xcode
 
 
Q