Skip to content

iOS icon generation fails with custom xcodeproj path when using flavors #637

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jierlausson opened this issue Apr 7, 2025 · 2 comments
Labels

Comments

@jierlausson
Copy link

jierlausson commented Apr 7, 2025

Description

When using flavor-specific launcher icons with a custom xcodeproj_path, the tool fails to update the project file despite following the documented flavor configuration pattern (flutter_launcher_icons-<flavor>.yaml).

Steps to Reproduce

  1. Create a Flutter project with flavors (dev, hml, prod) and custom iOS project name
  2. Create flavor-specific icon configuration files following the documentation pattern:

Example flutter_launcher_icons-hml.yaml:

flutter_launcher_icons:
  android: true
  ios: true
  image_path: "assets/icons/ic_launcher_hml.png"
  remove_alpha_ios: true
  xcodeproj_path: "ios/MyApp.xcodeproj"
  1. Run the flavor-specific command:
flutter pub get
dart run flutter_launcher_icons -f flutter_launcher_icons-hml.yaml

Current Behavior

The tool:

  1. Successfully generates the flavor-specific icons in Assets.xcassets
  2. Fails with path error, still looking for default Runner.xcodeproj:
✓ Successfully generated launcher icons
Unhandled exception:
PathNotFoundException: Cannot open file, path = 'ios/Runner.xcodeproj/project.pbxproj' (OS Error: No such file or directory, errno = 2)

Expected Behavior

The tool should:

  1. Generate the flavor-specific icons (currently working)
  2. Use the specified xcodeproj_path for project file updates
  3. Successfully complete the flavor-specific icon update process

Environment

  • Flutter version: 3.19.0
  • flutter_launcher_icons version: 0.14.3
  • Operating System: macOS Sonoma 14.3.1

Additional Context

  • The documentation explicitly supports flavors through flutter_launcher_icons-<flavor>.yaml files
  • Icon generation works correctly for flavors
  • The issue appears specific to project file updates when using both flavors and custom xcodeproj paths
  • Project structure follows Flutter flavor best practices with separate configurations for dev, hml, and prod environments

Related Documentation

From the official documentation:

Create a Flutter Launcher Icons configuration file for your flavor. The config file is called flutter_launcher_icons-.yaml by replacing by the name of your desired flavor.

@jierlausson jierlausson added the bug label Apr 7, 2025
@jierlausson jierlausson changed the title iOS icon generation fails when using custom xcodeproj name iOS icon generation fails when using custom xcodeproj path despite correct configuration Apr 7, 2025
@jierlausson jierlausson changed the title iOS icon generation fails when using custom xcodeproj path despite correct configuration iOS icon generation fails with custom xcodeproj path when using flavors Apr 7, 2025
@kjxbyz
Copy link

kjxbyz commented Apr 11, 2025

Same issue

@birdycn
Copy link

birdycn commented Apr 16, 2025

same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants