Skip to content

android/app module's project buildDir not correct after subprojects block merged #91018

Closed

Description

@littleGnAl

If there is a plugin project name's lexicographical order before 'app', the prject ':app' buildDir is not set correctly.

It seems this happened after this PR merged #77942

Step to produce:

flutter create -t plugin --platforms android,ios aaa
cd example
flutter build apk

There is an unexpected build folder under android/app.

image

flutter doctor -v

[✓] Flutter (Channel unknown, 2.6.0-12.0.pre.135, on macOS 11.6 20G165 darwin-x64, locale zh-Hans-CN)
    • Flutter version 2.6.0-12.0.pre.135 at /Users/fenglang/codes/source/flutter
    • Upstream repository unknown
    • Framework revision 3074c9e04b (28 hours ago), 2021-09-28 22:08:04 -0700
    • Engine revision bccb3a57eb
    • Dart version 2.15.0 (build 2.15.0-156.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/fenglang/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • 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.10+0-b96-7281165)

[✓] VS Code (version 1.60.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.26.0

[!] Proxy Configuration
    • HTTP_PROXY is set
    ! NO_PROXY is not set

[✓] Connected device (1 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 94.0.4606.61

! Doctor found issues in 1 category.

Activity

  1. littleGnAl commented on Sep 30, 2021

    @littleGnAl
    ContributorAuthor

    It works fine when I change it back to two subprojects block

    rootProject.buildDir = '../build'
    subprojects {
        project.buildDir = "${rootProject.buildDir}/${project.name}"
    }
    subprojects {
        project.evaluationDependsOn(':app')
    }
  2. TahaTesser commented on Sep 30, 2021

    @TahaTesser
    Contributor

    Hi @littleGnAl
    I can reproduce the behavior on the latest master, however as you mentioned this was changed after #77942 merged,
    I tried flutter commit before this PR was merged, yet I see the same result

    tahatesser@Tahas-MacBook-Pro app % pwd
    /Users/tahatesser/StudioProjects/aaa/example/android/app
    tahatesser@Tahas-MacBook-Pro app % ls
    build		build.gradle	src
    tahatesser@Tahas-MacBook-Pro app %
  3. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Sep 30, 2021
  4. littleGnAl commented on Sep 30, 2021

    @littleGnAl
    ContributorAuthor

    @TahaTesser I think you should delete the aaa project first, then re-run the scripts, as it's a "new flutter version"

  5. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Sep 30, 2021
  6. TahaTesser commented on Oct 1, 2021

    @TahaTesser
    Contributor

    Hi @littleGnAl
    Thanks, yes, when recreating the project the issue doesn't reproduce with older commits.

    previous version stable master
    ✅ ❗️ ❗️

    Check flutter doctor -v outputs for each channel below

    flutter doctor -v
    [✓] Flutter (Channel unknown, 2.1.0-13.0.pre.19, on macOS 12.0 21A5534d darwin-x64, locale en-GB)
        • Flutter version 2.1.0-13.0.pre.19 at /Users/tahatesser/Code/flutter
        • Framework revision 8bbaedde10 (7 months ago), 2021-03-10 10:05:03 -0800
        • Engine revision 785ac320e4
        • Dart version 2.13.0 (build 2.13.0-116.0.dev)
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
        • Android SDK at /Users/tahatesser/Code/SDK
        • Platform android-30, build-tools 29.0.2
        • ANDROID_HOME = /Users/tahatesser/Code/SDK
        • Java binary at: /Users/tahatesser/Code/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment Temurin-11.0.12+7 (build 11.0.12+7)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 13.0, Build version 13A233
        • CocoaPods version 1.11.2
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [!] Android Studio (version 2020.3)
        • 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
        ✗ Unable to find bundled Java version.
        • Try updating or re-installing Android Studio.
    
    [✓] VS Code (version 1.60.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.26.0
    
    [✓] Connected device (2 available)
        • macOS (desktop) • macos  • darwin-x64     • macOS 12.0 21A5534d darwin-x64
        • Chrome (web)    • chrome • web-javascript • Google Chrome 94.0.4606.61
    
    ! Doctor found issues in 1 category.
    [✓] Flutter (Channel stable, 2.5.2, on macOS 12.0 21A5534d darwin-x64, locale en-GB)
        • Flutter version 2.5.2 at /Users/tahatesser/Code/flutter_stable
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 3595343e20 (11 hours ago), 2021-09-30 12:58:18 -0700
        • Engine revision 6ac856380f
        • Dart version 2.14.3
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
        • Android SDK at /Users/tahatesser/Code/SDK
        • Platform android-30, build-tools 29.0.2
        • ANDROID_HOME = /Users/tahatesser/Code/SDK
        • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 13.0, Build version 13A233
        • CocoaPods version 1.11.2
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2020.3)
        • 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.10+0-b96-7281165)
    
    [✓] VS Code (version 1.60.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.26.0
    
    [✓] Connected device (2 available)
        • macOS (desktop) • macos  • darwin-x64     • macOS 12.0 21A5534d darwin-x64
        • Chrome (web)    • chrome • web-javascript • Google Chrome 94.0.4606.61
    
    • No issues found!
    [✓] Flutter (Channel master, 2.6.0-12.0.pre.150, on macOS 12.0 21A5534d darwin-x64, locale en-GB)
        • Flutter version 2.6.0-12.0.pre.150 at /Users/tahatesser/Code/flutter_master
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 367531447c (31 hours ago), 2021-09-29 20:03:04 -0400
        • Engine revision 9224a17d1c
        • Dart version 2.15.0 (build 2.15.0-162.0.dev)
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
        • Android SDK at /Users/tahatesser/Code/SDK
        • Platform android-30, build-tools 29.0.2
        • ANDROID_HOME = /Users/tahatesser/Code/SDK
        • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 13.0)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • CocoaPods version 1.11.2
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2020.3)
        • 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.10+0-b96-7281165)
    
    [✓] VS Code (version 1.60.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.26.0
    
    [✓] Connected device (2 available)
        • macOS (desktop) • macos  • darwin-x64     • macOS 12.0 21A5534d darwin-x64
        • Chrome (web)    • chrome • web-javascript • Google Chrome 94.0.4606.61
    
    • No issues found!

    ✅: No Issue ❗️: Issue reproduced

  7. added
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    platform-androidAndroid applications specifically
    c: regressionIt was better in the past than it is now
    toolAffects the "flutter" command-line tool. See also t: labels.
    and removed
    in triagePresently being triaged by the triage team
    on Oct 1, 2021
  8. added
    r: fixedIssue is closed as already fixed in a newer version
    on Oct 4, 2021
  9. github-actions commented on Oct 18, 2021

    @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.

  10. locked as resolved and limited conversation to collaborators on Oct 18, 2021
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

    c: 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 specificallyr: fixedIssue is closed as already fixed in a newer versiontoolAffects 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