Skip to content

fix: example iOS build fails with SPM package identity mismatch - #127

Open
muzahidul-opti wants to merge 1 commit into
masterfrom
fix/example-ios-spm-override
Open

muzahidul-opti wants to merge 1 commit into
masterfrom
fix/example-ios-spm-override

Conversation

@muzahidul-opti

Copy link
Copy Markdown
Contributor

Summary

 example/ios/Runner.xcodeproj  Flutter group
-  optimizely_flutter_sdk -> ../../ios/optimizely_flutter_sdk   # folder ref (added in #116)
   FlutterFramework
   FlutterGeneratedPluginSwiftPackage

Xcode treats a package folder added to a project as a local override, and it uses the folder name as the package identity (optimizely_flutter_sdk). Flutter's generated plugin package points at the same package through a symlink named optimizely-flutter-sdk. SPM won't let one package have two identities:

unable to override package 'optimizely_flutter_sdk' because its identity
'optimizely-flutter-sdk' doesn't match override's identity (directory name) 'optimizely_flutter_sdk'

Removing the folder reference leaves Flutter's generated package as the only reference to the plugin. You can still browse and edit the plugin sources through that package in Xcode.

Evidence

  • Before (master, checkout folder optimizely-flutter-sdk): cd example && flutter build ios --simulator --no-codesign → exit 1, the identity error above.
    After (this branch, same folder name): ✓ Built build/ios/iphonesimulator/Runner.app → exit 0.
  • The build also triggers Flutter 3.44's automatic migrations (UIScene in AppDelegate.swift/Info.plist, analyzer excludes in analysis_options.yaml). They aren't needed for this fix, so I left them out of this PR.

Merge Danger

Door: two-way. Revert the two removed lines.
Blast Radius: example app only. It isn't part of the pub.dev package, and CI doesn't build it. No effect on SDK consumers.

🤖 Generated with Claude Code

Runner.xcodeproj referenced ios/optimizely_flutter_sdk as a folder, which
Xcode treats as a local package override with identity
'optimizely_flutter_sdk'. Flutter's generated plugin package references the
same package via a symlink named 'optimizely-flutter-sdk', and SPM refuses
the mismatched identities.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant