Skip to content

flutter pub publish --dry-run shows a "Could not find an option named "dry-run" error #33302

Closed

Description

@MaikuB

Steps to Reproduce

  1. Create a package
  2. Execute flutter pub publish --dry-run

Logs

Could not find an option named "dry-run".


Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and options.
[✓] Flutter (Channel stable, v1.5.4-hotfix.2, on Mac OS X 10.14.5 18F132, locale en-AU)
    • Flutter version 1.5.4-hotfix.2 at /Users/michaelbui/flutter
    • Framework revision 7a4c33425d (4 weeks ago), 2019-04-29 11:05:24 -0700
    • Engine revision 52c7a1e849
    • Dart version 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/michaelbui/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = /Users/michaelbui/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
    • All Android licenses accepted.

[!] iOS toolchain - develop for iOS devices (Xcode 10.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.2.1, Build version 10E1001
    ✗ Verify that all connected devices have been paired with this computer in Xcode.
      If all devices have been paired, libimobiledevice and ideviceinstaller may require updating.
      To update with Brew, run:
        brew update
        brew uninstall --ignore-dependencies libimobiledevice
        brew uninstall --ignore-dependencies usbmuxd
        brew install --HEAD usbmuxd
        brew unlink usbmuxd
        brew link usbmuxd
        brew install --HEAD libimobiledevice
        brew install ideviceinstaller
    • ios-deploy 1.9.4
    ✗ CocoaPods not installed.
        CocoaPods is used to retrieve the iOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without resolving iOS dependencies with CocoaPods, plugins will not work on iOS.
        For more info, see https://flutter.dev/platform-plugins
      To install:
        brew install cocoapods
        pod setup

[✓] Android Studio (version 3.4)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 35.3.1
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[✓] IntelliJ IDEA Community Edition (version 2017.3.5)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 23.0.2
    • Dart plugin version 173.4700

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

[!] Connected device
    ! No devices available

Activity

  1. mit-mit commented on May 24, 2019

    @mit-mit
    Member

    @jonahwilliams any idea what is going on here? AFAICT we do pass the arguments to pub:

      Future<FlutterCommandResult> runCommand() async {
        await pub(<String>[_commandName]..addAll(argResults.rest), context: PubContext.pubForward, retry: false);
        return null;
      }
  2. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    on May 24, 2019
  3. viztushar commented on May 26, 2019

    @viztushar

    @MaikuB try flutter pub pub publish --dry-run

  4. umutseven92 commented on May 26, 2019

    @umutseven92

    Can confirm @viztushar's solution works. Until this is fixed, Developing packages & plugins
    page should be updated.

  5. MaikuB commented on May 27, 2019

    @MaikuB
    ContributorAuthor

    @viztushar Thanks. I've already been using the "old" command flutter packages pub publish --dry-run. This issue was created more to track that what's in the updated documentation doesn't work so the tooling can be updated and potentially have docs can be updated too

  6. mit-mit commented on May 28, 2019

    @mit-mit
    Member

    @jonahwilliams another repro for this (which doesn't risk running a publish command):

    (works): flutter pub pub deps --style list
    (doesn't work): flutter pub deps --style list

    I'm puzzled by this. I suspect the PackagesPassthroughCommand has some way of telling the args parser not to error on unknown args, but I don't see it in the code.

  7. everton-e26 commented on May 30, 2019

    @everton-e26

    flutter pub publish did not work too

    solved using
    flutter pub pub publish

  8. MaikuB commented on May 30, 2019

    @MaikuB
    ContributorAuthor

    @everton-e26 hmm interesting, flutter pub publish works for me. it's just the dry-run option that doesn't. i'm on the stable channel (v1.5.4-hotfix.2). i assume you're on the same version?

  9. d-wolf commented on Jun 4, 2019

    @d-wolf

    flutter pub publish did not work too

    solved using
    flutter pub pub publish

    same issue is described here: #32307

  10. everton-e26 commented on Jun 12, 2019

    @everton-e26

    @everton-e26 hmm interesting, flutter pub publish works for me. it's just the dry-run option that doesn't. i'm on the stable channel (v1.5.4-hotfix.2). i assume you're on the same version?

    yes! same

    Flutter 1.5.4-hotfix.2 • channel stable • https://github.com/flutter/flutter.git
    Framework • revision 7a4c334 (6 weeks ago) • 2019-04-29 11:05:24 -0700
    Engine • revision 52c7a1e
    Tools • Dart 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)

  11. MisterJimson commented on Jun 25, 2019

    @MisterJimson

    For me, both with and without --dry-run requires both pub pub

  12. vegaro commented on Jul 8, 2019

    @vegaro

    https://flutter.dev/docs/development/packages-and-plugins/developing-packages#publishing-packages

    The section:

    Finally, run the actual publish command:
    
    flutter pub publish
    

    Should also say: flutter pub pub publish. Otherwise my publish command hangs forever.

  13. huobazi commented on Aug 1, 2019

    @huobazi
    flutter pub pub publish
    

    also works for me

  14. mit-mit commented on Aug 1, 2019

    @mit-mit
    Member

    I would be very interested in getting a set of repro steps for a case where flutter pub publish hangs and flutter pub pub publish doesn't. They only known case for needing pub pub is to be able to pass --dry-run

  15. MaikuB commented on Aug 2, 2019

    @MaikuB
    ContributorAuthor

    Hmm I just had flutter pub publish hang for me after it list the files and tries to do an analysis. Not sure how I could provide more detailed steps. Compared to when it use to work, I'm on the latest stable (1.7.8+hotfix.4) and switched the account I use for publishing. Previously I was using a Gmail email address and now I'm using a custom email address via G Suite

  16. self-assigned this
    on Aug 13, 2019
  17. mit-mit commented on Aug 13, 2019

    @mit-mit
    Member

    Thanks for the error reports. I was finally able to repro this, and found a fix. Sorry about the trouble.

  18. github-actions commented on Aug 28, 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.

  19. locked as resolved and limited conversation to collaborators on Aug 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

toolAffects 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