Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tool][add-2-app] Debug and Profile modules are generated when passing --no-debug and --no-profile flags #108000

Closed
fja-icnh opened this issue Jul 20, 2022 · 14 comments · Fixed by #112149
Labels
a: existing-apps Integration with existing apps via the add-to-app flow c: regression It was better in the past than it is now found in release: 3.1 Found to occur in 3.1 has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list platform-android Android applications specifically r: fixed Issue is closed as already fixed in a newer version tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@fja-icnh
Copy link

On the master channel flutter build aar --no-debug --no-profile will result in also creating modules for debug and profile.

Steps to Reproduce

  1. flutter checkout master
  2. flutter create -t module module_test
  3. flutter build aar --no-debug --no-profile

Expected results:
On stable the following files are created:

build/host/outputs/repo/com/example/
└── module_test
    └── flutter_release
        ├── 1.0
        │   ├── flutter_release-1.0.aar
        │   ├── flutter_release-1.0.aar.md5
        │   ├── flutter_release-1.0.aar.sha1
        │   ├── flutter_release-1.0.pom
        │   ├── flutter_release-1.0.pom.md5
        │   └── flutter_release-1.0.pom.sha1
        ├── maven-metadata.xml
        ├── maven-metadata.xml.md5
        └── maven-metadata.xml.sha1

Actual results:
On master these files are created:

build/host/outputs/repo/com/example/
└── module_test
    ├── flutter
    │   ├── 1.0
    │   │   ├── flutter-1.0-debug.aar
    │   │   ├── flutter-1.0-debug.aar.md5
    │   │   ├── flutter-1.0-debug.aar.sha1
    │   │   ├── flutter-1.0-debug.aar.sha256
    │   │   ├── flutter-1.0-debug.aar.sha512
    │   │   ├── flutter-1.0-profile.aar
    │   │   ├── flutter-1.0-profile.aar.md5
    │   │   ├── flutter-1.0-profile.aar.sha1
    │   │   ├── flutter-1.0-profile.aar.sha256
    │   │   ├── flutter-1.0-profile.aar.sha512
    │   │   ├── flutter-1.0-release.aar
    │   │   ├── flutter-1.0-release.aar.md5
    │   │   ├── flutter-1.0-release.aar.sha1
    │   │   ├── flutter-1.0-release.aar.sha256
    │   │   ├── flutter-1.0-release.aar.sha512
    │   │   ├── flutter-1.0.module
    │   │   ├── flutter-1.0.module.md5
    │   │   ├── flutter-1.0.module.sha1
    │   │   ├── flutter-1.0.module.sha256
    │   │   ├── flutter-1.0.module.sha512
    │   │   ├── flutter-1.0.pom
    │   │   ├── flutter-1.0.pom.md5
    │   │   ├── flutter-1.0.pom.sha1
    │   │   ├── flutter-1.0.pom.sha256
    │   │   └── flutter-1.0.pom.sha512
    │   ├── maven-metadata.xml
    │   ├── maven-metadata.xml.md5
    │   ├── maven-metadata.xml.sha1
    │   ├── maven-metadata.xml.sha256
    │   └── maven-metadata.xml.sha512
    ├── flutter_debug
    │   ├── 1.0
    │   │   ├── flutter_debug-1.0.aar
    │   │   ├── flutter_debug-1.0.aar.md5
    │   │   ├── flutter_debug-1.0.aar.sha1
    │   │   ├── flutter_debug-1.0.aar.sha256
    │   │   ├── flutter_debug-1.0.aar.sha512
    │   │   ├── flutter_debug-1.0.module
    │   │   ├── flutter_debug-1.0.module.md5
    │   │   ├── flutter_debug-1.0.module.sha1
    │   │   ├── flutter_debug-1.0.module.sha256
    │   │   ├── flutter_debug-1.0.module.sha512
    │   │   ├── flutter_debug-1.0.pom
    │   │   ├── flutter_debug-1.0.pom.md5
    │   │   ├── flutter_debug-1.0.pom.sha1
    │   │   ├── flutter_debug-1.0.pom.sha256
    │   │   └── flutter_debug-1.0.pom.sha512
    │   ├── maven-metadata.xml
    │   ├── maven-metadata.xml.md5
    │   ├── maven-metadata.xml.sha1
    │   ├── maven-metadata.xml.sha256
    │   └── maven-metadata.xml.sha512
    ├── flutter_profile
    │   ├── 1.0
    │   │   ├── flutter_profile-1.0.aar
    │   │   ├── flutter_profile-1.0.aar.md5
    │   │   ├── flutter_profile-1.0.aar.sha1
    │   │   ├── flutter_profile-1.0.aar.sha256
    │   │   ├── flutter_profile-1.0.aar.sha512
    │   │   ├── flutter_profile-1.0.module
    │   │   ├── flutter_profile-1.0.module.md5
    │   │   ├── flutter_profile-1.0.module.sha1
    │   │   ├── flutter_profile-1.0.module.sha256
    │   │   ├── flutter_profile-1.0.module.sha512
    │   │   ├── flutter_profile-1.0.pom
    │   │   ├── flutter_profile-1.0.pom.md5
    │   │   ├── flutter_profile-1.0.pom.sha1
    │   │   ├── flutter_profile-1.0.pom.sha256
    │   │   └── flutter_profile-1.0.pom.sha512
    │   ├── maven-metadata.xml
    │   ├── maven-metadata.xml.md5
    │   ├── maven-metadata.xml.sha1
    │   ├── maven-metadata.xml.sha256
    │   └── maven-metadata.xml.sha512
    └── flutter_release
        ├── 1.0
        │   ├── flutter_release-1.0.aar
        │   ├── flutter_release-1.0.aar.md5
        │   ├── flutter_release-1.0.aar.sha1
        │   ├── flutter_release-1.0.aar.sha256
        │   ├── flutter_release-1.0.aar.sha512
        │   ├── flutter_release-1.0.module
        │   ├── flutter_release-1.0.module.md5
        │   ├── flutter_release-1.0.module.sha1
        │   ├── flutter_release-1.0.module.sha256
        │   ├── flutter_release-1.0.module.sha512
        │   ├── flutter_release-1.0.pom
        │   ├── flutter_release-1.0.pom.md5
        │   ├── flutter_release-1.0.pom.sha1
        │   ├── flutter_release-1.0.pom.sha256
        │   └── flutter_release-1.0.pom.sha512
        ├── maven-metadata.xml
        ├── maven-metadata.xml.md5
        ├── maven-metadata.xml.sha1
        ├── maven-metadata.xml.sha256
        └── maven-metadata.xml.sha512
@fja-icnh fja-icnh changed the title "flutter build aar" not working as expected on master "flutter build aar" not working as expected on master channel Jul 20, 2022
@fja-icnh
Copy link
Author

fja-icnh commented Jul 20, 2022

I'm also getting a Duplicate class error in my Android project when using a more complex flutter module that is built with the master branch. I then need to delete the flutter_release-1.0.module file in the flutter_release directory to get it working again.
This isn't an issue when using the stable branch.

@danagbemava-nc danagbemava-nc added the in triage Presently being triaged by the triage team label Jul 20, 2022
@danagbemava-nc
Copy link
Member

Issue is reproducible on master using the steps provided above.

Labeling for further investigation.

logs (flutter build aar --no-debug --no-profile -v )

master.log
stable.log

directory listings

stable

.
└── host
    └── outputs
        └── repo
            └── com
                └── example
                    └── m_stable
                        └── flutter_release
                            ├── 1.0
                            │   ├── flutter_release-1.0.aar
                            │   ├── flutter_release-1.0.aar.md5
                            │   ├── flutter_release-1.0.aar.sha1
                            │   ├── flutter_release-1.0.pom
                            │   ├── flutter_release-1.0.pom.md5
                            │   └── flutter_release-1.0.pom.sha1
                            ├── maven-metadata.xml
                            ├── maven-metadata.xml.md5
                            └── maven-metadata.xml.sha1

8 directories, 9 files

master

.
└── host
    └── outputs
        └── repo
            └── com
                └── example
                    └── m_master
                        ├── flutter
                        │   ├── 1.0
                        │   │   ├── flutter-1.0-debug.aar
                        │   │   ├── flutter-1.0-debug.aar.md5
                        │   │   ├── flutter-1.0-debug.aar.sha1
                        │   │   ├── flutter-1.0-debug.aar.sha256
                        │   │   ├── flutter-1.0-debug.aar.sha512
                        │   │   ├── flutter-1.0-profile.aar
                        │   │   ├── flutter-1.0-profile.aar.md5
                        │   │   ├── flutter-1.0-profile.aar.sha1
                        │   │   ├── flutter-1.0-profile.aar.sha256
                        │   │   ├── flutter-1.0-profile.aar.sha512
                        │   │   ├── flutter-1.0-release.aar
                        │   │   ├── flutter-1.0-release.aar.md5
                        │   │   ├── flutter-1.0-release.aar.sha1
                        │   │   ├── flutter-1.0-release.aar.sha256
                        │   │   ├── flutter-1.0-release.aar.sha512
                        │   │   ├── flutter-1.0.module
                        │   │   ├── flutter-1.0.module.md5
                        │   │   ├── flutter-1.0.module.sha1
                        │   │   ├── flutter-1.0.module.sha256
                        │   │   ├── flutter-1.0.module.sha512
                        │   │   ├── flutter-1.0.pom
                        │   │   ├── flutter-1.0.pom.md5
                        │   │   ├── flutter-1.0.pom.sha1
                        │   │   ├── flutter-1.0.pom.sha256
                        │   │   └── flutter-1.0.pom.sha512
                        │   ├── maven-metadata.xml
                        │   ├── maven-metadata.xml.md5
                        │   ├── maven-metadata.xml.sha1
                        │   ├── maven-metadata.xml.sha256
                        │   └── maven-metadata.xml.sha512
                        ├── flutter_debug
                        │   ├── 1.0
                        │   │   ├── flutter_debug-1.0.aar
                        │   │   ├── flutter_debug-1.0.aar.md5
                        │   │   ├── flutter_debug-1.0.aar.sha1
                        │   │   ├── flutter_debug-1.0.aar.sha256
                        │   │   ├── flutter_debug-1.0.aar.sha512
                        │   │   ├── flutter_debug-1.0.module
                        │   │   ├── flutter_debug-1.0.module.md5
                        │   │   ├── flutter_debug-1.0.module.sha1
                        │   │   ├── flutter_debug-1.0.module.sha256
                        │   │   ├── flutter_debug-1.0.module.sha512
                        │   │   ├── flutter_debug-1.0.pom
                        │   │   ├── flutter_debug-1.0.pom.md5
                        │   │   ├── flutter_debug-1.0.pom.sha1
                        │   │   ├── flutter_debug-1.0.pom.sha256
                        │   │   └── flutter_debug-1.0.pom.sha512
                        │   ├── maven-metadata.xml
                        │   ├── maven-metadata.xml.md5
                        │   ├── maven-metadata.xml.sha1
                        │   ├── maven-metadata.xml.sha256
                        │   └── maven-metadata.xml.sha512
                        ├── flutter_profile
                        │   ├── 1.0
                        │   │   ├── flutter_profile-1.0.aar
                        │   │   ├── flutter_profile-1.0.aar.md5
                        │   │   ├── flutter_profile-1.0.aar.sha1
                        │   │   ├── flutter_profile-1.0.aar.sha256
                        │   │   ├── flutter_profile-1.0.aar.sha512
                        │   │   ├── flutter_profile-1.0.module
                        │   │   ├── flutter_profile-1.0.module.md5
                        │   │   ├── flutter_profile-1.0.module.sha1
                        │   │   ├── flutter_profile-1.0.module.sha256
                        │   │   ├── flutter_profile-1.0.module.sha512
                        │   │   ├── flutter_profile-1.0.pom
                        │   │   ├── flutter_profile-1.0.pom.md5
                        │   │   ├── flutter_profile-1.0.pom.sha1
                        │   │   ├── flutter_profile-1.0.pom.sha256
                        │   │   └── flutter_profile-1.0.pom.sha512
                        │   ├── maven-metadata.xml
                        │   ├── maven-metadata.xml.md5
                        │   ├── maven-metadata.xml.sha1
                        │   ├── maven-metadata.xml.sha256
                        │   └── maven-metadata.xml.sha512
                        └── flutter_release
                            ├── 1.0
                            │   ├── flutter_release-1.0.aar
                            │   ├── flutter_release-1.0.aar.md5
                            │   ├── flutter_release-1.0.aar.sha1
                            │   ├── flutter_release-1.0.aar.sha256
                            │   ├── flutter_release-1.0.aar.sha512
                            │   ├── flutter_release-1.0.module
                            │   ├── flutter_release-1.0.module.md5
                            │   ├── flutter_release-1.0.module.sha1
                            │   ├── flutter_release-1.0.module.sha256
                            │   ├── flutter_release-1.0.module.sha512
                            │   ├── flutter_release-1.0.pom
                            │   ├── flutter_release-1.0.pom.md5
                            │   ├── flutter_release-1.0.pom.sha1
                            │   ├── flutter_release-1.0.pom.sha256
                            │   └── flutter_release-1.0.pom.sha512
                            ├── maven-metadata.xml
                            ├── maven-metadata.xml.md5
                            ├── maven-metadata.xml.sha1
                            ├── maven-metadata.xml.sha256
                            └── maven-metadata.xml.sha512

14 directories, 90 files
flutter doctor -v
[✓] Flutter (Channel stable, 3.0.5, on macOS 12.4 21F79 darwin-arm, locale en-GB)
    • Flutter version 3.0.5 at /Users/nexus/dev/sdks/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f1875d570e (7 days ago), 2022-07-13 11:24:16 -0700
    • Engine revision e85ea0e79c
    • Dart version 2.17.6
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/nexus/Library/Android/sdk
    • Platform android-32, build-tools 31.0.0
    • Java binary at: /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/212.5712.43.2112.8609683/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.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • 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)

[✓] Android Studio (version 2021.2)
    • Android Studio at /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/212.5712.43.2112.8609683/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)

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

[✓] Connected device (3 available)
    • M2007J20CG (mobile) • 5dd3be00 • android-arm64  • Android 11 (API 30)
    • macOS (desktop)     • macos    • darwin-arm64   • macOS 12.4 21F79 darwin-arm
    • Chrome (web)        • chrome   • web-javascript • Google Chrome 103.0.5060.114

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!
[✓] Flutter (Channel master, 3.1.0-0.0.pre.1754, on macOS 12.4 21F79 darwin-arm, locale en-GB)
    • Flutter version 3.1.0-0.0.pre.1754 on channel master at /Users/nexus/dev/sdks/flutters
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ac539c57c1 (3 hours ago), 2022-07-20 00:53:06 -0400
    • Engine revision 184e9b13fb
    • Dart version 2.19.0 (build 2.19.0-13.0.dev)
    • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/nexus/Library/Android/sdk
    • Platform android-32, build-tools 31.0.0
    • Java binary at: /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/212.5712.43.2112.8609683/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.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 13F100
    • 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)

[✓] Android Studio (version 2021.2)
    • Android Studio at /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/212.5712.43.2112.8609683/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)

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

[✓] Connected device (3 available)
    • M2007J20CG (mobile) • 5dd3be00 • android-arm64  • Android 11 (API 30)
    • macOS (desktop)     • macos    • darwin-arm64   • macOS 12.4 21F79 darwin-arm
    • Chrome (web)        • chrome   • web-javascript • Google Chrome 103.0.5060.114

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

@danagbemava-nc danagbemava-nc added platform-android Android applications specifically tool Affects the "flutter" command-line tool. See also t: labels. a: existing-apps Integration with existing apps via the add-to-app flow has reproducible steps The issue has been confirmed reproducible and is ready to work on found in release: 3.1 Found to occur in 3.1 c: regression It was better in the past than it is now and removed in triage Presently being triaged by the triage team labels Jul 20, 2022
@danagbemava-nc
Copy link
Member

I'm also getting a Duplicate class error in my Android project when using a more complex flutter module that is built with the master branch. I then need to delete the flutter_release-1.0.module file in the flutter_release directory to get it working again.
This isn't an issue when using the stable branch.

Hi @fja-icnh, kindly file a new issue for this and provide the necessary information required to reproduce.

Thanks

@danagbemava-nc danagbemava-nc changed the title "flutter build aar" not working as expected on master channel [tool][add-2-app] Debug and Profile modules are generated when passing --no-debug and --no-profile flags Jul 22, 2022
@GaryQian GaryQian added the P1 High-priority issues at the top of the work list label Jul 26, 2022
@christopherfujino
Copy link
Member

@GaryQian do you know where this may have been introduced?

@GaryQian
Copy link
Contributor

Unclear off the top of my head. I personally am not aware of any risky change that landed recently that may cause this. It is likely a bug caused by something else.

@christopherfujino
Copy link
Member

@GaryQian is it possible your gradle upgrade caused this change in behavior?

Possible related: #108742

@GaryQian
Copy link
Contributor

GaryQian commented Aug 2, 2022

This was reported before my gradle changes landed.

I'm not aware of anything off the top of my head that landed recently that is at risk of causing this.

@Jasguerrero
Copy link
Contributor

@GaryQian With this information Do you still think this is a P3?

@fja-icnh
Copy link
Author

fja-icnh commented Sep 6, 2022

Sadly this can now also be found in the Flutter 3.3.0 release 😔

@christopherfujino christopherfujino added P2 Important issues not at the top of the work list and removed P1 High-priority issues at the top of the work list labels Sep 6, 2022
@kndl22
Copy link

kndl22 commented Sep 7, 2022

Facing same issue on 3.3.0 on stable channel

@myroid
Copy link

myroid commented Sep 9, 2022

Facing same issue on 3.3.1 on stable channel

@christopherfujino
Copy link
Member

christopherfujino commented Sep 9, 2022

@fja-icnh @kndl22 @myroid thank you for contributing, however please restrict comments on the issue trackers to contributing new information that would help fixing the issue. If an issue is still open, it is generally assumed to be broken at HEAD, and thus we don't need notifications each time there is a new release.

The primary way to raise the visibility of an issue that you are affected by is to thumbs up the original post, as we sort on this during issue triage. Thanks!

@JunhuaLin
Copy link
Contributor

JunhuaLin commented Sep 15, 2022

Steps to Reproduce: #111643

1.flutter checkout master
2.flutter create -t module module_test
3.flutter build aar --no-debug --no-profile --build-number 1.0.0

Expected results:

On stable the following files are created:

implementation 'com.example.module_test:flutter_release:1.0.0'

Actual results:

On master these files are created:

implementation 'com.example.module_test:flutter:1.0.0:release'


The following methods will not work

implementation 'com.example.module_test:flutter:1.0.+:release'
implementation 'com.example.module_test:flutter:1.+:release'

I want the implementation to support fuzzy matching. for example:

implementation 'com.example.module_test:flutter_release:1.0.+'
implementation 'com.example.module_test:flutter_release:1.+'

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: existing-apps Integration with existing apps via the add-to-app flow c: regression It was better in the past than it is now found in release: 3.1 Found to occur in 3.1 has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list platform-android Android applications specifically r: fixed Issue is closed as already fixed in a newer version tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants