Skip to content

improve error message when gradlew assembledebug is used with -Pdart-defines that are not base64 encoded #95116

Description

@schilken

I propose a better error message when -Pdart-defines are not base64 encoded.

With Flutter 2.5 the following message is output:
"Error parsing assemble command: your generated configuration may be out of date. Try re-running 'flutter build ios' or the appropriate build command."

This message didn't help. Only a search for the message in the flutter_tools source revealed the true cause of the problem:

A message containing a hint about the required base64 encoding would be more helpful for many developers using integration tests with CI. They will probably use -Pdart-defines to add some parameters for their tests.

Steps to Reproduce

  1. in android folder of any project
  2. run ./gradlew app:assembleDebug -Pdart-defines=MY_ENV=whatever

Logs

./gradlew app:assembleDebug -Pdart-defines=MY_ENV=whatever
...

Task :app:compileFlutterBuildDebug FAILED
Error parsing assemble command: your generated configuration may be out of date. Try re-running 'flutter build ios' or the appropriate build command.

A gradlew task with correct base64 encoded dart-defines build without problem.

The issue is just the misleading error message.

./gradlew app:assembleDebug -Pdart-defines=TVlfRU5WPXdoYXRldmVy
...
BUILD SUCCESSFUL in 15s

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: proposalA detailed proposal for a change to Flutterplatform-androidAndroid applications specificallyt: gradle"flutter build" and "flutter run" on Androidteam-androidOwned by Android platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-androidTriaged by Android platform team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions