Repository navigation
when building app bundle with multiple flavorDimension, tool cannot locate .aab file #65264
Copy link
Copy link
Closed
Closed
Copy link
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: releaseChallenges faced when attempting to productionize an appChallenges faced when attempting to productionize an appfound in release: 3.10Found to occur in 3.10Found to occur in 3.10found in release: 3.7Found to occur in 3.7Found to occur in 3.7has 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 specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versiont: gradle"flutter build" and "flutter run" on Android"flutter build" and "flutter run" on AndroidtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
I was having trouble building a flutter app with 2 flavor dimensions and 2 flavors for each dimension (total of 4 variants,
excluding the debug and release modes).
here's a minimal flutter app repo: https://github.com/brightknight08/flutter_build_appbundle_error to reproduce
when I do flutter build appbundle --release --flavor signedprod, it would display
Gradle build failed to produce an .aab file. It's likely that this file was generated under
E:\lab\flutter_build_appbundle_error\build, but the tool couldn't find it.
flutter doctor -v
PS E:\lab\flutter_build_appbundle_error> flutter doctor -v
[✓] Flutter (Channel stable, 1.20.2, on Microsoft Windows [Version 10.0.19041.450], locale en-US)
• Flutter version 1.20.2 at C:\flutter
• Framework revision bbfbf1770c (3 weeks ago), 2020-08-13 08:33:09 -0700
• Engine revision 9d5b21729f
• Dart version 2.9.1
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at E:\asdk
• Platform android-30, build-tools 30.0.2
• ANDROID_HOME = E:\asdk
• Java binary at: E:\as\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
• All Android licenses accepted.
[✓] Android Studio (version 4.0)
• Android Studio at E:\as
• Flutter plugin version 48.1.2
• Dart plugin version 193.7547
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[✓] VS Code (version 1.48.2)
• VS Code at C:\Users\tim_m\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.14.0
[✓] Connected device (1 available)
• P[redacted]...droid-arm64 • Android 10 (API 29)
• No issues found!
PS E:\lab\flutter_build_appbundle_error>
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: releaseChallenges faced when attempting to productionize an appChallenges faced when attempting to productionize an appfound in release: 3.10Found to occur in 3.10Found to occur in 3.10found in release: 3.7Found to occur in 3.7Found to occur in 3.7has 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 specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versiont: gradle"flutter build" and "flutter run" on Android"flutter build" and "flutter run" on AndroidtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Activity
TahaTesser commentedon Sep 7, 2020
Hi @brightknight08
Can you please try this solution
Thank you
brightknight08 commentedon Sep 9, 2020
thank you for pointing me in that direction @TahaTesser . is this the supposed "fix"?
TahaTesser commentedon Sep 9, 2020
Hi @brightknight08
Wanted to make sure if it the same issue or not, if the workaround is working or not, it's for APK but after more testing, APK builds without using that workaround. The issue is only app bundle only.
.aabfile is generated if you go build but the tool can't locateflutter build apk --release --flavor signedprodInterestingly, it works with APK
flutter build appbundle --release --flavor signedprodappbundle_logs.txt
flutter doctor -v
flutter doctor -v
17 remaining items
adgeg commentedon Apr 13, 2023
Leaving another note here, cause I've been struggled for many hours 💩. @PiotrWpl solution was working perfectly fine on my laptop, but not on my project's CI/CD (Github Actions), with a strange log "Skipping task copyAndRenameAab[...] as it has no source files and no previous output files".
@PiotrWpl solution works perfectly on Mac OS and Windows, but not on Ubuntu, as it is a case sensitive OS. So for people having the same issue, you need to add something additional to make it works on all OS. In @PiotrWpl solution,
originalDirPathis always in lower case, you need this to make it with proper case (only changes areproductFlavorsCapitalizedand new value oforiginalDirPath):Hope this may help.
Edit : I should have looked more carefully @btrautmann comment…
fix: Gradle custom task to make it work on Mac OS AND Ubuntu
exaby73 commentedon Apr 18, 2023
I can still reproduce this issue with
Master (3.10.0-7.0.pre.17).Logs
flutter doctor -v(Master)gnprice commentedon May 5, 2023
There's some experimentation and discussion on #124797 (thanks @pepompeu!) which I think will be helpful for resolving this issue.
See in particular @andrewkolos's repro recipe at #124797 (comment), and my suggestion at #124797 (comment) to have
--flavortake a comma-separated list of flavors, as influtter build appbundle --flavor someFlavor,someOtherFlavor.fix(flutter_tools): `findBundleFile` w/multiple flavor dimensions (#1…
fix(flutter_tools): `findBundleFile` w/multiple flavor dimensions (fl…
github-actions commentedon Jun 3, 2023
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.