Repository navigation
flutter build swift-package: generated FlutterPluginRegistrant fails with "conflicting name: 'Sentry'" when using sentry_flutter #189443
Copy link
Copy link
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: existing-appsIntegration with existing apps via the add-to-app flowIntegration with existing apps via the add-to-app flowfyi-toolFor the attention of Flutter Tool teamFor the attention of Flutter Tool teamhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyiOS applications specificallyt: xcode"xcodebuild" on iOS and general Xcode project management"xcodebuild" on iOS and general Xcode project managementteam-iosOwned by iOS platform teamOwned by iOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-iosTriaged by iOS platform teamTriaged by iOS platform team
Description
Activity
- addedin triagePresently being triaged by the triage teamPresently being triaged by the triage teamplatform-iosiOS applications specificallyiOS applications specificallyhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work ontoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.t: xcode"xcodebuild" on iOS and general Xcode project management"xcodebuild" on iOS and general Xcode project managementteam-toolOwned by Flutter Tool teamOwned by Flutter Tool teamand removedhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on Jul 14, 2026 Hi @xiaoxiaowuelisa, thanks for the rteport.
Reproduced on macOS with Flutter 3.44.6 following the steps —
swift buildfails with:multiple packages ('debug', 'sentry-cocoa') declare targets with a conflicting name: 'Sentry'Routing to the tool team for further investigation.
Reacted by Alessio Salvadorini- addedteam-iosOwned by iOS platform teamOwned by iOS platform teamfyi-toolFor the attention of Flutter Tool teamFor the attention of Flutter Tool teamand removedteam-toolOwned by Flutter Tool teamOwned by Flutter Tool team
on Aug 4, 2026 - addeda: existing-appsIntegration with existing apps via the add-to-app flowIntegration with existing apps via the add-to-app flow
on Aug 6, 2026 - addedP2Important issues not at the top of the work listImportant issues not at the top of the work listtriaged-iosTriaged by iOS platform teamTriaged by iOS platform team
on Aug 6, 2026 - added a commit that references this issue
on Aug 21, 2026 This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.- locked as resolved and limited conversation to collaborators
on Sep 4, 2026
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: existing-appsIntegration with existing apps via the add-to-app flowIntegration with existing apps via the add-to-app flowfyi-toolFor the attention of Flutter Tool teamFor the attention of Flutter Tool teamhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyiOS applications specificallyt: xcode"xcodebuild" on iOS and general Xcode project management"xcodebuild" on iOS and general Xcode project managementteam-iosOwned by iOS platform teamOwned by iOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-iosTriaged by iOS platform teamTriaged by iOS platform team
Steps to reproduce
sentry_flutter: ^9.24.0to my_module/pubspec.yaml under dependenciesExpected results
flutter build swift-package --platform iosgenerates aFlutterPluginRegistrantSwift package whose dependency graph resolves and builds successfully, so it can
be added to a host Xcode project (or built standalone with
swift build) withouterrors, even when the Flutter module depends on sentry_flutter.
Actual results
swift build(and Xcode package resolution) fails with:error: multiple packages ('debug', 'sentry-cocoa') declare targets with a
conflicting name: 'Sentry'; target names need to be unique across the
package graph
This happens because the generated
FlutterPluginRegistrant/Package.swiftdeclares a local binaryTarget built from CocoaPods:
while also depending on sentry_flutter's own copied
Package.swift(
Packages/sentry_flutter/Package.swift), which separately declares a remoteSPM dependency that vends its own target also named "Sentry":
Both "Sentry" targets end up in the same package graph simultaneously, causing
the name collision.
Code sample
Code sample
pubspec.yaml for a minimal Flutter module used in add-to-app:
Generated files relevant to the conflict:
build/ios/SwiftPackages/FlutterNativeIntegration/Debug/Package.swift:build/ios/SwiftPackages/FlutterNativeIntegration/Debug/Packages/sentry_flutter/Package.swift:Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output