Thanks to visit codestin.com
Credit goes to github.com

Skip to content

flutter create shows a long list of added pub dependencies, even though the user hasn't added anything yet #116227

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

Closed
jmagman opened this issue Nov 29, 2022 · 10 comments · Fixed by #118285
Assignees
Labels
found in release: 3.6 Found to occur in 3.6 has reproducible steps The issue has been confirmed reproducible and is ready to work on P1 High-priority issues at the top of the work list r: fixed Issue is closed as already fixed in a newer version tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@jmagman
Copy link
Member

jmagman commented Nov 29, 2022

Most of the output from flutter create is showing the pub dependencies that are added from every blank template. Suppress this on an initial create, it adds a lot of noise, and the user hasn't explicitly added these dependencies so it's confusing and hiding the actually interesting "how to run" instructions.

Similar request to #93036.
Probably caused by #110851?

$ flutter create test_create
Creating project test_create...
Running "flutter pub get" in test_create...                        997ms
Resolving dependencies in test_create...
+ async 2.10.0
+ boolean_selector 2.1.1
+ characters 1.2.1
+ clock 1.1.1
+ collection 1.17.0
+ cupertino_icons 1.0.5
+ fake_async 1.3.1
+ flutter 0.0.0 from sdk flutter
+ flutter_lints 2.0.1
+ flutter_test 0.0.0 from sdk flutter
+ js 0.6.5
+ lints 2.0.1
+ matcher 0.12.13
+ material_color_utilities 0.2.0
+ meta 1.8.0
+ path 1.8.2
+ sky_engine 0.0.99 from sdk flutter
+ source_span 1.9.1
+ stack_trace 1.11.0
+ stream_channel 2.1.1
+ string_scanner 1.2.0
+ term_glyph 1.2.1
+ test_api 0.4.16
+ vector_math 2.1.4
Changed 24 dependencies in test_create!
Wrote 127 files.

All done!
You can find general documentation for Flutter at: https://docs.flutter.dev/
Detailed API documentation is available at: https://api.flutter.dev/
If you prefer video documentation, consider:
https://www.youtube.com/c/flutterdev

In order to run your application, type:

  $ cd test_create
  $ flutter run

Your application code is in test_create/lib/main.dart.
@jmagman jmagman added the tool Affects the "flutter" command-line tool. See also t: labels. label Nov 29, 2022
@danagbemava-nc
Copy link
Member

Reproducible only on master.

logs
nexus@Daniels-MBP nevercode % flutterm create n
Creating project n...
Running "flutter pub get" in n...                                2,065ms
Resolving dependencies in n...
+ async 2.10.0
+ boolean_selector 2.1.1
+ characters 1.2.1
+ clock 1.1.1
+ collection 1.17.0
+ cupertino_icons 1.0.5
+ fake_async 1.3.1
+ flutter 0.0.0 from sdk flutter
+ flutter_lints 2.0.1
+ flutter_test 0.0.0 from sdk flutter
+ js 0.6.5
+ lints 2.0.1
+ matcher 0.12.13
+ material_color_utilities 0.2.0
+ meta 1.8.0
+ path 1.8.2
+ sky_engine 0.0.99 from sdk flutter
+ source_span 1.9.1
+ stack_trace 1.11.0
+ stream_channel 2.1.1
+ string_scanner 1.2.0
+ term_glyph 1.2.1
+ test_api 0.4.16
+ vector_math 2.1.4
Changed 24 dependencies in n!
Wrote 127 files.

All done!
You can find general documentation for Flutter at: https://docs.flutter.dev/
Detailed API documentation is available at: https://api.flutter.dev/
If you prefer video documentation, consider: https://www.youtube.com/c/flutterdev

In order to run your application, type:

  $ cd n
  $ flutter run

Your application code is in n/lib/main.dart.
flutter doctor -v
[!] Flutter (Channel master, 3.6.0-12.0.pre.20, on macOS 13.0.1 22A400 darwin-arm64, locale en-GB)
    • Flutter version 3.6.0-12.0.pre.20 on channel master at /Users/nexus/dev/sdks/flutters
    ! Warning: `flutter` on your path resolves to /Users/nexus/dev/sdks/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/nexus/dev/sdks/flutters. Consider adding /Users/nexus/dev/sdks/flutters/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /Users/nexus/dev/sdks/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/nexus/dev/sdks/flutters. Consider adding /Users/nexus/dev/sdks/flutters/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 02de12947a (9 hours ago), 2022-11-29 22:57:31 -0500
    • Engine revision d5690468da
    • Dart version 2.19.0 (build 2.19.0-443.0.dev)
    • DevTools version 2.20.0
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/nexus/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/213.7172.25.2113.9123335/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14B47b
    • CocoaPods version 1.11.3

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

[!] Android Studio
    • Android Studio at /Applications/Android Studio Preview.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.

[✓] Android Studio (version 2021.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.13+0-b1751.21-8125866)

[!] Android Studio
    • Android Studio at /Applications/Android Studio Preview 2.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.

[✓] Android Studio (version 2021.3)
    • Android Studio at /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/213.7172.25.2113.9123335/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.13+0-b1751.21-8125866)

[✓] Android Studio (version 2021.3)
    • Android Studio at /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/213.7172.25.2113.9014738/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.13+0-b1751.21-8125866)

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

[✓] Connected device (4 available)
    • M2007J20CG (mobile)    • 5dd3be00                             • android-arm64  • Android 12 (API 31)
    • iPhone 14 Pro (mobile) • 4F72110C-F38B-4CF9-93C4-4D6042148D28 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-1 (simulator)
    • macOS (desktop)        • macos                                • darwin-arm64   • macOS 13.0.1 22A400 darwin-arm64
    • Chrome (web)           • chrome                               • web-javascript • Google Chrome 108.0.5359.71

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

! Doctor found issues in 3 categories.

@danagbemava-nc danagbemava-nc added has reproducible steps The issue has been confirmed reproducible and is ready to work on found in release: 3.6 Found to occur in 3.6 labels Nov 30, 2022
@jmagman
Copy link
Member Author

jmagman commented Nov 30, 2022

@sigurdm

@sigurdm
Copy link
Contributor

sigurdm commented Dec 1, 2022

I guess we can suppress the output of flutter pub get run from flutter create if it is too much.

We internally in pub get have a "quiet" mode (only reports success or failure), and could perhaps expose and use that.
@jonasfj WDYT?

@sigurdm
Copy link
Contributor

sigurdm commented Dec 1, 2022

@jonasfj suggests that we activate the quiet (one line summary) behaviour in pub depending on some environment variable.

Perhaps we can even look at the PUB_ENVIRONMENT that is set by flutter_tools.

@jmagman
Copy link
Member Author

jmagman commented Dec 1, 2022

I think it's okay to have on flutter pub get but not flutter create

@christopherfujino
Copy link
Contributor

It sounds like the action item here is to provide the environment variable from dart-lang/pub#3679 ONLY during pub get from the flutter create sub-command.

@christopherfujino christopherfujino added the P1 High-priority issues at the top of the work list label Dec 6, 2022
@christopherfujino
Copy link
Contributor

This code already supports not inheriting stdio for tests, we should also use that for the flutter create workflow. cc @andrewkolos

@jmagman
Copy link
Member Author

jmagman commented Jan 12, 2023

Is there any way we can suppress Resolving/Got lines as well?

Resolving dependencies in test_thing...
Got dependencies in test_thing.

@andrewkolos
Copy link
Contributor

andrewkolos commented Jan 12, 2023

Is there any way we can suppress Resolving/Got lines as well?

Resolving dependencies in test_thing...
Got dependencies in test_thing.

#118285, which closed this issue, uses the recently-added PUB_SUMMARY_ONLY env var, which still prints the two lines you mentioned. This was used for its simplicity and it avoids the vast majority of the noise generated by pub get during flutter create.

Regarding the two lines you mentioned, I imagine it's possible to avoid them by instead having pub get not inherit stdio from flutter create (it would still listen on stderr for the sake error reporting). However, I am personally unsure that it's worth the development effort or code complexity to do so, only because I don't find these two lines to be very noisy. I'm interested in any further thoughts

edited for typos

@danagbemava-nc danagbemava-nc added the r: fixed Issue is closed as already fixed in a newer version label Jan 13, 2023
@github-actions
Copy link

github-actions bot commented Mar 4, 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 -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
found in release: 3.6 Found to occur in 3.6 has reproducible steps The issue has been confirmed reproducible and is ready to work on P1 High-priority issues at the top of the work list 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
5 participants