Skip to content

fix: support renamed Apple Xcode projects#451

Open
SelaseKay wants to merge 3 commits into
mainfrom
fix_217
Open

fix: support renamed Apple Xcode projects#451
SelaseKay wants to merge 3 commits into
mainfrom
fix_217

Conversation

@SelaseKay

Copy link
Copy Markdown
Contributor

Description

Fixes support for Flutter Apple projects where the .xcodeproj has been renamed from the default Runner.xcodeproj.

The CLI now discovers the Xcode project under the selected Apple platform directory, preferring Runner.xcodeproj when present and falling back to a single renamed .xcodeproj.

Fixes #217

Type of Change

  • feat -- New feature (non-breaking change which adds functionality)
  • 🛠️ fix -- Bug fix (non-breaking change which fixes an issue)
  • ! -- Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 refactor -- Code refactor
  • ci -- Build configuration change
  • 📝 docs -- Documentation
  • 🗑️ chore -- Chore

Reuse PlatformDirectoryDoesNotExistException for the missing platform
directory case instead of a bespoke message, drop a redundant sort in
getXcodeProjectPath, and make the bundle id auto-detection in
FlutterApp fall back to manual entry instead of throwing when the
Xcode project can't be unambiguously resolved. Adds tests covering the
validation wiring and the ambiguous-project fallback.

@russellwheatley russellwheatley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix for #217, this is the right approach. A few things I want to flag and I've pushed a follow up commit addressing them:

  1. xcodeProjectFileInDirectory is also used in flutter_app.dart for bundle id auto detection, which used to degrade gracefully (fall back to manual entry) when the project file was missing. With getXcodeProjectPath it now throws if there's zero or multiple .xcodeproj folders, and this path isn't gated by Platform.isMacOS, so a non Mac teammate configuring an iOS enabled app could hit a hard failure in an edge case that previously just prompted for a bundle id. I made this tolerant of that again.

  2. There's already a PlatformDirectoryDoesNotExistException for the missing platform directory case, reused it instead of a bespoke XcodeProjectException message.

  3. Added a couple of wiring level tests (through appleValidation and FlutterApp) since the existing tests only covered getXcodeProjectPath in isolation.

  4. Removed a redundant sort that wasn't needed until building the multi project error message.

Pushed to fix_217 directly since it's not a fork. Tests, analyzer and format all pass.

@russellwheatley russellwheatley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you write an e2e test to confirm it works, and I think e2e tests need resolving

@SelaseKay
SelaseKay deployed to CI Environment July 17, 2026 14:36 — with GitHub Actions Active
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.

[bug]: Unable to open .../ios/Runner.xcodeproj because it doesn't exist.

3 participants