Repository navigation
[tool] flutter run runs only app.apk #111585
Copy link
Copy link
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 toolc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityfound in release: 3.3Found to occur in 3.3Found to occur in 3.3found in release: 3.4Found to occur in 3.4Found to occur in 3.4has 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
Steps to Reproduce
- Configure flavors for the Android app, such as "inside".
flutter run --flavor=inside- The
Installing xxx.apkhas a different path fromBuilt xxx.apk.
android/app/build.gradle:
//......
android {
//......
flavorDimensions "app"
productFlavors {
inside {}
play {}
}
}
//......(LocalFile is my additional print.)
[!] Flutter (Channel master, 3.4.0-19.0.pre.254, on Microsoft Windows [版本 10.0.22000.856], locale zh-CN)
• Flutter version 3.4.0-19.0.pre.254 on channel master at X:\SDK\flutter-master
! Upstream repository https://github.com/AlexV525/flutter is not a standard remote.
Set environment variable "FLUTTER_GIT_URL" to https://github.com/AlexV525/flutter to dismiss this error.
• Framework revision 6b1f84fe10 (66 minutes ago), 2022-09-14 09:46:00 -0700
• Engine revision 179d528f6a
• Dart version 2.19.0 (build 2.19.0-197.0.dev)
• DevTools version 2.17.0
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: buildBuilding flutter applications with the toolBuilding flutter applications with the toolc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityfound in release: 3.3Found to occur in 3.3Found to occur in 3.3found in release: 3.4Found to occur in 3.4Found to occur in 3.4has 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.

Activity
huycozy commentedon Sep 15, 2022
Hi @AlexV525, thanks for filing the issue. This issue is reproducible on the latest
stableandmasterchannels.flutter doctor -v
[✓] Flutter (Channel stable, 3.3.2, on macOS 12.5.1 21G83 darwin-x64, locale en-VN) • Flutter version 3.3.2 on channel stable at /Users/huynq/Documents/GitHub/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision e3c29ec00c (12 hours ago), 2022-09-14 08:46:55 -0500 • Engine revision a4ff2c53d8 • Dart version 2.18.1 • DevTools version 2.15.0 [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0) • Android SDK at /Users/huynq/Library/Android/sdk • Platform android-33, build-tools 31.0.0 • ANDROID_HOME = /Users/huynq/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 13.3) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 13E113 • CocoaPods version 1.11.3 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2021.2) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840) [✓] IntelliJ IDEA Community Edition (version 2022.1.1) • IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart [✓] VS Code (version 1.71.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.48.0 [✓] Connected device (2 available) • macOS (desktop) • macos • darwin-x64 • macOS 12.5.1 21G83 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 105.0.5195.125 [✓] HTTP Host Availability • All required HTTP hosts are available • No issues found![✓] Flutter (Channel master, 3.4.0-19.0.pre.270, on macOS 12.5.1 21G83 darwin-x64, locale en-VN) • Flutter version 3.4.0-19.0.pre.270 on channel master at /Users/huynq/Documents/GitHub/flutter_master • Upstream repository https://github.com/flutter/flutter.git • Framework revision c4c1b0b0b7 (41 minutes ago), 2022-09-14 21:22:29 -0400 • Engine revision 3a49977f8b • Dart version 2.19.0 (build 2.19.0-199.0.dev) • DevTools version 2.17.0 [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0) • Android SDK at /Users/huynq/Library/Android/sdk • Platform android-33, build-tools 31.0.0 • ANDROID_HOME = /Users/huynq/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 13.3) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 13E113 • CocoaPods version 1.11.3 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2021.2) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840) [✓] IntelliJ IDEA Community Edition (version 2022.1.1) • IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart [✓] VS Code (version 1.71.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.48.0 [✓] Connected device (2 available) • macOS (desktop) • macos • darwin-x64 • macOS 12.5.1 21G83 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 105.0.5195.125 [✓] HTTP Host Availability • All required HTTP hosts are available • No issues found![-][tool] Incorrect installing APK path during running[/-][+][tool] `flutter run` does not include flavor in apk path[/+]GaryQian commentedon Sep 20, 2022
cc @GaryQian for reference
GaryQian commentedon Sep 20, 2022
It seems that the only place we are using flavor when determining file names is in gradle.dart where the build output includes the flavor. The call paths of the run command do not seem to read the flavor attribute in. We simply don't use the flavor parameter.
GaryQian commentedon Sep 20, 2022
However, it is reasonable expected for flavors to work here, so this isn't a new feature but rather something that has been overlooked and should be implemented.
AlexV525 commentedon Sep 21, 2022
If it's a huge change for a flavor flag, I'd prefer to hide the path from the "Installing" line.
AlexV525 commentedon Oct 2, 2022
I managed to make it work, and it doesn't require a lot of changes.
[-][tool] `flutter run` does not include flavor in apk path[/-][+][tool] `flutter run` runs only `app.apk`[/+]github-actions commentedon Nov 2, 2022
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.