Skip to content

[iOS] Improve the error message if code signing config is incorrect #167595

Description

@loic-sharma

Use case

If I download a Flutter iOS project that uses code signing config that I don't have access to, I'll get an error like:

$ flutter run
Launching lib/main.dart on Loïc’s iPhone 15 in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: ABCDEF123
Running Xcode build...
Xcode build done.                                           13.4s
Failed to build iOS app
Could not build the precompiled application for the device.
Error (Xcode): No Account for Team "ABCDEF123". Add a new account in Accounts settings or verify that your accounts
have valid credentials.
/path/to/my/app/ios/Runner.xcodeproj


Error (Xcode): No profiles for 'com.example.app' were found: Xcode couldn't find any iOS App Development
provisioning profiles matching 'com.example.app'.
/path/to/my/app/ios/Runner.xcodeproj



It appears that there was a problem signing your application prior to installation on the device.

Verify that the Bundle Identifier in your project is your signing id in Xcode
  open ios/Runner.xcworkspace

Also try selecting 'Product > Build' to fix the problem.

Error launching application on Loïc’s iPhone 15.

Proposal

Consider the following changes to the error message:

  $ flutter run
  Launching lib/main.dart on Loïc’s iPhone 15 in debug mode...
  Automatically signing iOS for device deployment using specified development team in Xcode project: ABCDEF123
  Running Xcode build...
  Xcode build done.                                           13.4s
  Failed to build iOS app
- Could not build the precompiled application for the device.
+
+ Error: could not code sign the application.

  Error (Xcode): No Account for Team "ABCDEF123". Add a new account in Accounts settings or verify that your accounts
  have valid credentials.
  /path/to/my/app/ios/Runner.xcodeproj
  
  
  Error (Xcode): No profiles for 'com.example.app' were found: Xcode couldn't find any iOS App Development
  provisioning profiles matching 'com.example.app'.
  /path/to/my/app/ios/Runner.xcodeproj
  
- It appears that there was a problem signing your application prior to installation on the device.
-  
- Verify that the Bundle Identifier in your project is your signing id in Xcode
-   open ios/Runner.xcworkspace
- 
- Also try selecting 'Product > Build' to fix the problem.
- 
-  Error launching application on Loïc’s iPhone 15.
+ To fix this:
+ 
+ 1. Open the project in Xcode:
+ 
+    open ios/Runner.xcworspace
+    
+ 2. Open the Runner target and the Signing & Capabilities tab.
+
+    Verify that the Team is correct.
+    Verify that the Bundle Identifier is correct.
+    
+ 3. Open Xcode > Settings > Accounts.
+
+    Verify that you are signed in to the correct Apple Developer account.
+    
+ 4. Fix any issues reported by Product > Build.

Metadata

Metadata

Labels

P2Important issues not at the top of the work listplatform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-iosTriaged by iOS platform team

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions