Skip to content

fix(tooling): stop passing --flavor to a project with no product flavors - #37

Merged
koniz-dev merged 1 commit into
mainfrom
fix/drop-nonexistent-gradle-flavors
Aug 26, 2026
Merged

fix(tooling): stop passing --flavor to a project with no product flavors#37
koniz-dev merged 1 commit into
mainfrom
fix/drop-nonexistent-gradle-flavors

Conversation

@koniz-dev

Copy link
Copy Markdown
Owner

build.yml offered a flavor input and passed it to flutter build for Android
and iOS. android/app/build.gradle.kts declares no productFlavors, so:

Task 'assembleDevelopmentRelease' not found in root project 'android'
[!] The android/app/build.gradle.kts file does not define any custom product
    flavors. You cannot use the --flavor option.

The working code path settled the design question

The web job in the same workflow already omitted --flavor and passed only
--dart-define=ENVIRONMENT - which is why web was the one platform that built.
That is the project's actual convention, not a workaround:

  • lib/core/config/app_config.dart:33 reads ENVIRONMENT from .env or
    --dart-define.
  • docs/guides/configuration.md documents env layering and dart-defines.
  • No productFlavors have ever existed in the Gradle config.

So I dropped --flavor rather than inventing flavors. Adding real ones would also
require iOS schemes, which cannot be created from a script here, and would add
surface a starter does not need.

Renamed the input

flavor -> environment, described as "Value passed as
--dart-define=ENVIRONMENT". Calling it a flavor is what made the mistake
plausible in the first place. Artifact names and the concurrency group follow the
rename.

Verified by dispatching

Run Result
32971439671 platform=android success in 6m23s, artifact android-apks-development (32,223,960 bytes)
32971452663 platform=web success in 1m17s, artifact web-build-development (14,226,706 bytes) - not regressed

That Android APK is the first this repository has ever produced in CI.

Deploy workflows

deploy-android.yml had --flavor "$ENV" inside its commented-out build
template; removed, so uncommenting it does not reproduce the bug.
deploy-ios.yml turned out to have no such line - I asserted it did and the
assertion caught me. Neither was dispatched: they publish to stores.

Refs #34

build.yml offered a `flavor` input and passed it to `flutter build` for
Android and iOS. android/app/build.gradle.kts declares no productFlavors, so:

  Task 'assembleDevelopmentRelease' not found in root project 'android'
  [!] The android/app/build.gradle.kts file does not define any custom product
      flavors. You cannot use the --flavor option.

The web job in the same workflow already omitted --flavor and passed only
--dart-define=ENVIRONMENT, which is why web was the one platform that built.
That working path is the project's actual convention: app_config.dart:33 reads
ENVIRONMENT from .env or --dart-define, and docs/guides/configuration.md
documents env layering, not Gradle flavors.

So: dropped --flavor rather than inventing productFlavors. Adding real flavors
would also need iOS schemes, which cannot be created from a script here, and
would add surface a starter does not need.

Renamed the input `flavor` -> `environment` with a description saying what it
actually controls. Calling it a flavor is what made the mistake plausible.
Artifact names and the concurrency group follow the rename.

Also removed the `--flavor "$ENV"` line from deploy-android.yml's
commented-out build template, so uncommenting it does not reproduce the bug.
deploy-ios.yml had no such line.

Refs #34
@koniz-dev
koniz-dev merged commit fc4c603 into main Aug 26, 2026
8 checks passed
@koniz-dev
koniz-dev deleted the fix/drop-nonexistent-gradle-flavors branch August 26, 2026 13:08
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