-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: buildBuilding flutter applications with the toolBuilding flutter applications with the toolfound in release: 2.5Found to occur in 2.5Found to occur in 2.5found in release: 2.6Found to occur in 2.6Found to occur in 2.6has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyAndroid applications specificallytoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
Given two flavor dimensions: app and type
examplebeing in theappdimensionprodbeing in thetypedimension
and Flutter build command: flutter build appbundle --release --flavor exampleProd --verbose flutter_tools is looking for the AAB file in:
build/app/outputs/bundle/release/app.aabbuild/app/outputs/bundle/release/app-release.aabbuild/app/outputs/bundle/exampleprodRelease/app.aabbuild/app/outputs/bundle/exampleprodRelease/app-exampleprod-release.aab
And it's actually located inbuild/app/outputs/bundle/exampleProdRelease/app-example-prod-release.aab therefore the command fails to complete sucessfully.
Gradle build failed to produce an .aab file. It's likely that this file was generated under (...)/build, but the tool couldn't find it.
Related flutter_tools source code:
flutter/packages/flutter_tools/lib/src/android/gradle.dart
Lines 850 to 888 in cf885c1
| @visibleForTesting | |
| File findBundleFile(FlutterProject project, BuildInfo buildInfo, Logger logger, Usage usage) { | |
| final List<File> fileCandidates = <File>[ | |
| getBundleDirectory(project) | |
| .childDirectory(camelCase(buildInfo.modeName)) | |
| .childFile('app.aab'), | |
| getBundleDirectory(project) | |
| .childDirectory(camelCase(buildInfo.modeName)) | |
| .childFile('app-${buildInfo.modeName}.aab'), | |
| ]; | |
| if (buildInfo.flavor != null) { | |
| // The Android Gradle plugin 3.0.0 adds the flavor name to the path. | |
| // For example: In release mode, if the flavor name is `foo_bar`, then | |
| // the directory name is `foo_barRelease`. | |
| fileCandidates.add( | |
| getBundleDirectory(project) | |
| .childDirectory('${buildInfo.lowerCasedFlavor}${camelCase('_${buildInfo.modeName}')}') | |
| .childFile('app.aab')); | |
| // The Android Gradle plugin 3.5.0 adds the flavor name to file name. | |
| // For example: In release mode, if the flavor name is `foo_bar`, then | |
| // the file name name is `app-foo_bar-release.aab`. | |
| fileCandidates.add( | |
| getBundleDirectory(project) | |
| .childDirectory('${buildInfo.lowerCasedFlavor}${camelCase('_${buildInfo.modeName}')}') | |
| .childFile('app-${buildInfo.lowerCasedFlavor}-${buildInfo.modeName}.aab')); | |
| } | |
| for (final File bundleFile in fileCandidates) { | |
| if (bundleFile.existsSync()) { | |
| return bundleFile; | |
| } | |
| } | |
| _exitWithExpectedFileNotFound( | |
| project: project, | |
| fileExtension: '.aab', | |
| logger: logger, | |
| usage: usage, | |
| ); | |
| } |
Flutter 2.5.1 • channel unknown • unknown source
Framework • revision ffb2ecea52 (5 weeks ago) • 2021-09-17 15:26:33 -0400
Engine • revision b3af521a05
Tools • Dart 2.14.2
bartekpacia, szakes1, strtomek, mateuszwojtczak, mariazebrowska and 9 more
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: buildBuilding flutter applications with the toolBuilding flutter applications with the toolfound in release: 2.5Found to occur in 2.5Found to occur in 2.5found in release: 2.6Found to occur in 2.6Found to occur in 2.6has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyAndroid applications specificallytoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.