Skip to content

[tool] flutter run runs only app.apk #111585

Description

@AlexV525

Steps to Reproduce

  1. Configure flavors for the Android app, such as "inside".
  2. flutter run --flavor=inside
  3. The Installing xxx.apk has a different path from Built xxx.apk.

android/app/build.gradle:

//......
android {
    //......
    flavorDimensions "app"
    productFlavors {
        inside {}
        play {}
    }
}
//......

image

(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

Activity

  1. added
    in triagePresently being triaged by the triage team
    on Sep 15, 2022
  2. huycozy commented on Sep 15, 2022

    @huycozy
    Member

    Hi @AlexV525, thanks for filing the issue. This issue is reproducible on the latest stable and master channels.

    • Logs
    ✓  Built build/app/outputs/flutter-apk/app-development-debug.apk.
    Installing build/app/outputs/flutter-apk/app.apk...
    
    • Flavor config:
    productFlavors {
            development {}
            production {}
        }
    
    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!
    
  3. added
    platform-androidAndroid applications specifically
    toolAffects the "flutter" command-line tool. See also t: labels.
    a: buildBuilding flutter applications with the tool
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    and removed
    in triagePresently being triaged by the triage team
    on Sep 15, 2022
  4. changed the title [-][tool] Incorrect installing APK path during running[/-] [+][tool] `flutter run` does not include flavor in apk path[/+] on Sep 20, 2022
  5. added
    P2Important issues not at the top of the work list
    on Sep 20, 2022
  6. GaryQian commented on Sep 20, 2022

    @GaryQian
    Contributor

    cc @GaryQian for reference

  7. GaryQian commented on Sep 20, 2022

    @GaryQian
    Contributor

    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.

  8. GaryQian commented on Sep 20, 2022

    @GaryQian
    Contributor

    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.

  9. AlexV525 commented on Sep 21, 2022

    @AlexV525
    MemberAuthor

    If it's a huge change for a flavor flag, I'd prefer to hide the path from the "Installing" line.

  10. AlexV525 commented on Oct 2, 2022

    @AlexV525
    MemberAuthor

    I managed to make it work, and it doesn't require a lot of changes.

    image

  11. changed the title [-][tool] `flutter run` does not include flavor in apk path[/-] [+][tool] `flutter run` runs only `app.apk`[/+] on Oct 4, 2022
  12. github-actions commented on Nov 2, 2022

    @github-actions

    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 -v and a minimal reproduction of the issue.

  13. locked as resolved and limited conversation to collaborators on Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: buildBuilding flutter applications with the toolc: new featureNothing broken; request for a new capabilityfound in release: 3.3Found to occur in 3.3found in release: 3.4Found to occur in 3.4has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallytoolAffects 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