Skip to content

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

@jierlausson

Description

@jierlausson

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions