Skip to content

[Linux] Build failure with uppercased flavor configuration #91582

@untoldone

Description

@untoldone

Steps to Reproduce

  1. Create flutter project on a linux system with a case-sensitive file system
  2. Create flavors for the project with upper-case letters
  3. build appbundle for android

Expected results: builds successfully

Actual results: does not. e.g.

Gradle build failed to produce an .aab file. It's likely that this file was generated under <PATH>, but the tool couldn't find it.
       <asynchronous suspension>
       #8      CommandRunner.runCommand (package:args/command_runner.dart:209:13)
       <asynchronous suspension>
       #9      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:288:9)
       <asynchronous suspension>
       #10     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
       <asynchronous suspension>
       #11     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:236:5)
       <asynchronous suspension>
       #12     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
       <asynchronous suspension>
       #13     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
       <asynchronous suspension>
       #14     main (package:flutter_tools/executable.dart:92:3)
       <asynchronous suspension>

I'm guessing this is the result of

.childDirectory('${buildInfo.lowerCasedFlavor}${camelCase('_${buildInfo.modeName}')}')
using lowerCasedFlavor instead of flavor

I assume the fix would involve either switching to flavor or ensuring the output directory for the flavor is lowercased.

This does NOT reproduce on a mac machine and probably doesn't repro on windows as they are case insensitive by default.

I did write a quick test as well and verified the outputted path is incorrect by adding print of the search paths in the referenced file.

Also as an aside the aab was correctly output and signed despite the build process failing. Given the location in code of the exception, this really only seems to prevent the output of the final line which says ✓ Built <OUTPUT_PATH> (<SIZE>MB). and then causes the build to have a non-zero exit which prevents any CI system from progressing successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: buildBuilding flutter applications with the toolc: regressionIt was better in the past than it is nowfound in release: 2.5Found to occur in 2.5found in release: 2.6Found to occur in 2.6has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyplatform-linuxBuilding on or for Linux specificallyr: fixedIssue is closed as already fixed in a newer versiont: gradle"flutter build" and "flutter run" on AndroidtoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions