Repository: flutter
Issue: App fails to build with incorrect "plugin:" section in pubspec.yaml, "flutter build ios" fails with missing GeneratedPluginRegistrant
Labels: c: regression,c: crash,platform-ios,tool,has reproducible steps,P3,found in release: 2.0,found in release: 2.1,team-ios,triaged-ios

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill out the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Steps to Reproduce

I try to build the sentry_flutter example app on the beta channel (2.1.0-12.2.pre) from here https://github.com/getsentry/sentry-dart/tree/main/flutter/example 

1.  Checkout repo, navigate to the example.
2. Run `flutter clean`
3. Run `flutter build ios --release --no-codesign `
4. It fails with the error message as seen below in Logs

## Logs

<details>
<summary>Logs</summary>

<!--
      Include the full logs of the commands you are running between the lines
      with the backticks below. If you are running any "flutter" commands,
      please include the output of running them with "--verbose"; for example,
      the output of running "flutter --verbose create foo".
-->

```
example % flutter build ios --no-codesign
Warning: Building for device with codesigning disabled. You will have to manually codesign before deploying to device.
Building io.sentry.flutter.example for device (ios-release)...
Upgrading contents.xcworkspacedata
Running pod install...                                           1.961ms
Running Xcode build...                                                  
 └─Compiling, linking and signing...                        666ms
Xcode build done.                                           52,3s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    /Users/jonas/Documents/projects/sentry-dart/flutter/example/ios/Runner/Runner-Bridging-Header.h:1:9: error: 'GeneratedPluginRegistrant.h' file not found
    #import "GeneratedPluginRegistrant.h"
            ^
    1 error generated.
    <unknown>:0: error: failed to emit precompiled header '/Users/jonas/Library/Developer/Xcode/DerivedData/Runner-ctlzmwjnvqpzhveviguiglkeqdnt/Build/Intermediates.noindex/PrecompiledHeaders/Runner-Bridging-Header-swift_4FVZ7D3OM2GN-clang_1GXEPMYTXIRGY.pch'
    for bridging header '/Users/jonas/Documents/projects/sentry-dart/flutter/example/ios/Runner/Runner-Bridging-Header.h'
    /Users/jonas/Documents/projects/sentry-dart/flutter/example/ios/Runner/Runner-Bridging-Header.h:1:9: error: 'GeneratedPluginRegistrant.h' file not found
    #import "GeneratedPluginRegistrant.h"
            ^
    1 error generated.
    <unknown>:0: error: failed to emit precompiled header '/Users/jonas/Library/Developer/Xcode/DerivedData/Runner-ctlzmwjnvqpzhveviguiglkeqdnt/Build/Intermediates.noindex/PrecompiledHeaders/Runner-Bridging-Header-swift_3HSXYR6LG6BL9-clang_1QPC4EPBC31OW.pch'
    for bridging header '/Users/jonas/Documents/projects/sentry-dart/flutter/example/ios/Runner/Runner-Bridging-Header.h'
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

════════════════════════════════════════════════════════════════════════════════
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/setup/#deploy-to-ios-devices

Or run on an iOS simulator without code signing
════════════════════════════════════════════════════════════════════════════════
Encountered error while building for device.
```

<!-- If possible, paste the output of running `flutter doctor -v` here. -->

```
jonas@JonasMacBookPro example % flutter --version              
Flutter 2.1.0-12.2.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision 5bedb7b1d5 (5 days ago) • 2021-03-17 17:06:30 -0700
Engine • revision 711ab3fda0
Tools • Dart 2.13.0 (build 2.13.0-116.0.dev)
jonas@JonasMacBookPro example % flutter doctor -v                       
[✓] Flutter (Channel beta, 2.1.0-12.2.pre, on macOS 11.2.3 20D91 darwin-x64, locale de-DE)
    • Flutter version 2.1.0-12.2.pre at /Users/jonas/Documents/projects/flutter
    • Framework revision 5bedb7b1d5 (5 days ago), 2021-03-17 17:06:30 -0700
    • Engine revision 711ab3fda0
    • Dart version 2.13.0 (build 2.13.0-116.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/jonas/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /Users/jonas/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.7042882/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.4, Build version 12D4e
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Users/jonas/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.7042882/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 1.8.0_242-release-1644-b3-6915495)

[✓] IntelliJ IDEA Ultimate Edition (version 2020.3.3)
    • IntelliJ at /Users/jonas/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.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.54.3)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.20.0

[✓] Connected device (3 available)
    • iPhone 12 Pro Max (mobile) • 57DFFEAC-3903-449E-8EEF-1F6F3E5A8DC4 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
    • macOS (desktop)            • macos                                • darwin-x64     • macOS 11.2.3 20D91 darwin-x64
    • Chrome (web)               • chrome                               • web-javascript • Google Chrome 89.0.4389.90

• No issues found!
```

</details>