Repository: flutter
Issue: `flutter run` iOS error "undefined symbols" does not output full error
Labels: platform-ios,tool,t: xcode,a: error message,P2,needs repro info,team-ios,triaged-ios


_Originally posted by @alexeyinkin in https://github.com/flutter/flutter/issues/154663#issuecomment-2333724855_

1. Create a project with `flutter create temp2`.
2. Add `firebase_analytics: 11.3.0` to `pubspec.yaml` (note no `^` to pin this specific broken version).
3. Replace in files `IPHONEOS_DEPLOYMENT_TARGET = 12.0` with `IPHONEOS_DEPLOYMENT_TARGET = 13.0`.
4. Open Runner.xcworkspace in Xcode and set a unique bundle identifier.
5. Run `flutter devices` to learn the ID of your iPhone.
6. Run `flutter run -d your_device_id`

This gave me an error I haven't seen before:

```
Launching lib/main.dart on Alexey Inkin's iPhone in debug mode...
Automatically signing iOS for device deployment using specified development team
in Xcode project: DNLKN6QZ24
Running pod install...                                              3,3s
Running Xcode build...                                                  
Xcode build done.                                           37,1s
Failed to build iOS app
Could not build the precompiled application for the device.
Error (Xcode): Provisioning profile "iOS Team Provisioning Profile:
com.alexeyinkintemp2" doesn't include the currently selected device "Alexey’s
MacBook Pro" (identifier XXXXXXXX-XXXXXXXXXXXXXXXX).
/Users/ai/temp/temp2/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 Alexey Inkin's iPhone.
```

I followed the advice to build with Xcode first. It gave me this error (the symbols are visible if clicking the hamburger icon):
<img width="958" alt="Captura de pantalla 2024-09-06 a las 14 05 09" src="https://github.com/user-attachments/assets/27f24196-e7ef-47a3-9c14-b3921925802b">

After that failure, I was able to reproduce the missing symbols message with re-running `flutter run ...`:

```
Launching lib/main.dart on Alexey Inkin's iPhone in debug mode...
Automatically signing iOS for device deployment using specified development team
in Xcode project: DNLKN6QZ24
Running Xcode build...                                                  
 └─Compiling, linking and signing...                      1.325ms
Xcode build done.                                           10,0s
Failed to build iOS app
Could not build the precompiled application for the device.
Error (Xcode): Undefined symbols:


Error (Xcode): Linker command failed with exit code 1 (use -v to see invocation)



Error launching application on Alexey Inkin's iPhone.
```

<details><summary>flutter doctor -v</summary>
<p>

```
[✓] Flutter (Channel stable, 3.24.2, on macOS 13.6 22G120 darwin-arm64, locale
    es-GE)
    • Flutter version 3.24.2 on channel stable at /Users/ai/bin/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 4cf269e36d (3 days ago), 2024-09-03 14:30:00 -0700
    • Engine revision a6bd3f1de1
    • Dart version 3.5.2
    • DevTools version 2.37.2

[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/ai/Library/Android/sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/to/macos-android-setup for more details.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A240d
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build
      17.0.10+0-17.0.10b1087.21-11609105)

[✓] IntelliJ IDEA Ultimate Edition (version 2023.3.3)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.90.0)
    • VS Code at /Users/ai/bin/Visual Studio Code.app/Contents
    • Flutter extension version 3.90.0

[✓] Connected device (4 available)
    • Alexey Inkin's iPhone (mobile)  • 0dec698e7e1f6bfbe7bdd7e1b311ca5b2fd3199c
      • ios            • iOS 15.8.3 19H386
    • macOS (desktop)                 • macos
      • darwin-arm64   • macOS 13.6 22G120 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad
      • darwin         • macOS 13.6 22G120 darwin-arm64
    • Chrome (web)                    • chrome
      • web-javascript • Google Chrome 128.0.6613.120

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.
```

</p>
</details> 

Xcode Version 15.0 (15A240d)