Skip to content

【ERROR】Unable to pub upgrade flutter tool. Retrying in five seconds... #13349

Closed

Description

@1997y1

ubuntu 17.04

环境搭建遇到错误

git clone -b alpha https://github.com/flutter/flutter.git
evanyan@ps:~$ flutter doctor
Building flutter tool...
The setter 'readEventsEnabled=' was called on null.
Receiver: null
Tried calling: readEventsEnabled=false
package:pub/src/source/hosted.dart 338                    BoundHostedSource._throwFriendlyError
package:pub/src/source/hosted.dart 140                    BoundHostedSource.doGetVersions
===== asynchronous gap ===========================
package:pub/src/source.dart 165                           BoundSource.getVersions
package:pub/src/solver/version_solver.dart 231            SolverCache.getVersions.<fn>
dart:async                                                runZoned
package:pub/src/http.dart 228                             withDependencyType
package:pub/src/solver/version_solver.dart 230            SolverCache.getVersions
===== asynchronous gap ===========================
package:pub/src/solver/unselected_package_queue.dart 121  UnselectedPackageQueue._getNumVersions
===== asynchronous gap ===========================
package:pub/src/solver/unselected_package_queue.dart 50   UnselectedPackageQueue.add
===== asynchronous gap ===========================
package:pub/src/solver/version_selection.dart 68          VersionSelection.select.<fn>
===== asynchronous gap ===========================
dart:async                                                _completeOnAsyncReturn
package:pub/src/solver/version_selection.dart 70          VersionSelection.select.<fn>
dart:async                                                _completeOnAsyncReturn
package:pub/src/solver/unselected_package_queue.dart 54   UnselectedPackageQueue.add
dart:async                                                _completeOnAsyncReturn
package:pub/src/solver/unselected_package_queue.dart 128  UnselectedPackageQueue._getNumVersions
dart:async                                                _Completer.completeError
package:pub/src/solver/version_solver.dart 254            SolverCache.getVersions
dart:async                                                _Completer.completeError
package:pub/src/source/hosted.dart 153                    BoundHostedSource.doGetVersions
dart:async                                                _Completer.completeError
package:http/src/base_client.dart 172                     BaseClient._sendUnstreamed
dart:async                                                _Completer.completeError
package:http_throttle/http_throttle.dart 51               ThrottleClient.send
dart:async                                                _Completer.completeError
package:pub/src/http.dart 127                             _PubHttpClient.send
dart:async                                                _Completer.completeError
package:http/src/io_client.dart 66                        IOClient.send
This is an unexpected error. Please run

    pub --trace upgrade --verbosity=error --no-packages-dir

and include the logs in an issue on https://github.com/dart-lang/pub/issues/new
Error: Unable to pub upgrade flutter tool. Retrying in five seconds...

Activity

  1. eseidelGoogle commented on Dec 5, 2017

    @eseidelGoogle
    Contributor

    Presumably this is an access error to pub.dartlang.org which is causing a cascading failure? Which means there are several things wrong. @mit-mit

  2. JavenLu commented on Dec 16, 2017

    @JavenLu

    i have a problem,please help!

    junludeMBP:~ Javen$ flutter doctor
    Building flutter tool...
    Got socket error trying to find package coverage at https://pub.dartlang.org.
    Error: Unable to pub upgrade flutter tool. Retrying in five seconds...
    Connection failed (OS Error: No route to host, errno = 65), address = storage.googleapis.com, port = 443
    Error: Unable to pub upgrade flutter tool. Retrying in five seconds...

    @eseidelGoogle
    thank you very much

  3. eseidelGoogle commented on Dec 16, 2017

    @eseidelGoogle
    Contributor

    If you're in China, please try https://github.com/flutter/flutter/wiki/Using-Flutter-in-China and let us know if that doesn't work.

  4. JavenLu commented on Dec 17, 2017

    @JavenLu

    Thanks! it works! @eseidelGoogle

  5. added
    t: flutter doctorProblem related to the "flutter doctor" tool
    a: first hourThe first hour of using Flutter
    on Jan 9, 2018
  6. added this to the 3: Current Milestone milestone on Jan 9, 2018
  7. Hixie commented on Jan 9, 2018

    @Hixie
    Contributor

    These are all probably dupes of each other: #12301 #12702 #13222 #13349

  8. kendeng9898 commented on Jan 9, 2018

    @kendeng9898

    Check http_proxy or system wide proxy have setting. remove the proxy setting. My Ubuntu 16.04, got this error. After remove the proxy setting everything go well.

  9. modified the milestones: 3: Current Milestone, on Jan 30, 2018
  10. linguowu commented on Feb 6, 2018

    @linguowu

    still get the error when i
    export PUB_HOSTED_URL=https://pub.flutter-io.cn
    export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
    then i run the example of hello_world
    Running "flutter packages get" in hello_world...

    ERR : Connection failed (OS Error: No route to host, errno = 65), address = storage.googleapis.com, port = 443

    that will make me give up .......

  11. InMatrix commented on Feb 6, 2018

    @InMatrix

    @linguowu Can you run the default app created by flutter create?

  12. linguowu commented on Feb 7, 2018

    @linguowu

    @InMatrix
    when i run "flutter create myapp"
    it shows below:

    Running "flutter packages get" in myapp...
    Got socket error trying to find package cupertino_icons at https://pub.dartlang.org.

  13. InMatrix commented on Feb 7, 2018

    @InMatrix

    @linguowu It looks like the environmental variables were not working. Can you provide the following information for diagnostic purposes:

    • output of echo $PUB_HOSTED_URL
    • output of echo $FLUTTER_STORAGE_BASE_URL
    • output of ls ~/.pub-cache/hosted
    • output of flutter doctor -v

    Also, did you use the mirror to install Flutter?

    Thank you for your patience.

  14. linguowu commented on Feb 8, 2018

    @linguowu

    @InMatrix
    how to get the mirror to install Flutter?

    below is the output for diagnostic:
    `country5deMacBook-Pro-2:~ country5$ echo $PUB_HOSTED_URL

    country5deMacBook-Pro-2:~ country5$ echo $FLUTTER_STORAGE_BASE_URL

    country5deMacBook-Pro-2:~ country5$ ls ~/.pub-cache/hosted
    pub.dartlang.org pub.flutter-io.cn

    country5deMacBook-Pro-2:~ country5$ flutter doctor -v
    [  +14 ms] [/Users/country5/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
    [  +28 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
    [        ] origin/alpha
    [        ] [/Users/country5/flutter/] git rev-parse --abbrev-ref HEAD
    [   +8 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
    [        ] alpha
    [        ] [/Users/country5/flutter/] git ls-remote --get-url origin
    [   +8 ms] Exit code 0 from: git ls-remote --get-url origin
    [        ] https://github.com/flutter/flutter.git
    [        ] [/Users/country5/flutter/] git log -n 1 --pretty=format:%H
    [   +6 ms] Exit code 0 from: git log -n 1 --pretty=format:%H
    [        ] 2e449f06f0a3be076e336ad6b30b0e9ec99dbdfe
    [        ] [/Users/country5/flutter/] git log -n 1 --pretty=format:%ar
    [   +6 ms] Exit code 0 from: git log -n 1 --pretty=format:%ar
    [        ] 9 days ago
    [        ] [/Users/country5/flutter/] git describe --match v*.*.* --first-parent --long --tags
    [   +7 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long --tags
    [        ] v0.0.21-0-g2e449f0
    [ +135 ms] /usr/bin/defaults read /Applications/Android Studio.app/Contents/Info CFBundleShortVersionString
    [  +61 ms] Exit code 0 from: /usr/bin/defaults read /Applications/Android Studio.app/Contents/Info CFBundleShortVersionString
    [        ] 3.0
    [ +129 ms] [✓] Flutter (on Mac OS X 10.12 16A323, locale zh-Hans-CN, channel alpha)
    [        ]     • Flutter version 0.0.21 at /Users/country5/flutter
    [        ]     • Framework revision 2e449f06f0 (9 days ago), 2018-01-29 14:26:51 -0800
    [        ]     • Engine revision 6921873c71
    [        ]     • Tools Dart version 2.0.0-dev.16.0
    [        ]     • Engine Dart version 2.0.0-edge.da1f52592ef73fe3afa485385cb995b9aec0181a
    [   +6 ms] /usr/bin/defaults read /Applications/Android Studio.app/Contents/Info CFBundleShortVersionString
    [  +59 ms] Exit code 0 from: /usr/bin/defaults read /Applications/Android Studio.app/Contents/Info CFBundleShortVersionString
    [        ] 3.0
    [  +64 ms] java -version
    [  +63 ms] [✓] Android toolchain - develop for Android devices (Android SDK 26.0.2)
    [        ]     • Android SDK at /Users/country5/Development/android-sdk-macosx
    [        ]     • Android NDK at /Users/country5/Development/android-sdk-macosx/ndk-bundle
    [        ]     • Platform android-26, build-tools 26.0.2
    [        ]     • 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-915-b08)
    [  +99 ms] DevToolsSecurity -status
    [  +31 ms] Developer mode is currently enabled.
    [        ] python -c import six
    [  +35 ms] idevice_id -h
    [   +6 ms] idevice_id -h
    [   +4 ms] idevice_id -l
    [  +14 ms] ideviceinstaller -h
    [   +6 ms] ios-deploy --version
    [  +11 ms] ios-deploy --version
    [   +9 ms] 1.9.2
    [        ] ios-deploy --version
    [   +8 ms] ios-deploy --version
    [  +10 ms] 1.9.2
    [   +1 ms] pod --version
    [ +276 ms] pod --version
    [ +276 ms] 1.3.1
    [   +1 ms] pod --version
    [ +267 ms] 1.3.1
    [        ] [-] iOS toolchain - develop for iOS devices (Xcode 8.0)
    [        ]     • Xcode at /Applications/Xcode.app/Contents/Developer
    [        ]     • Xcode 8.0, Build version 8A218a
    [        ]     ✗ Flutter requires a minimum Xcode version of 9.0.0.
                     Download the latest version or update via the Mac App Store.
    [        ]     • ios-deploy 1.9.2
    [        ]     • CocoaPods version 1.3.1
    [   +1 ms] [✓] Android Studio (version 3.0)
    [        ]     • Android Studio at /Applications/Android Studio.app/Contents
    [        ]     • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)
    [  +21 ms] /Users/country5/Development/android-sdk-macosx/platform-tools/adb devices -l
    [  +13 ms] Exit code 0 from: /Users/country5/Development/android-sdk-macosx/platform-tools/adb devices -l
    [        ] List of devices attached
               ENU7N15A30000390       device usb:337641472X product:angler model:Nexus_6P device:angler transport_id:2
    [   +7 ms] idevice_id -h
    [  +18 ms] /Users/country5/Development/android-sdk-macosx/platform-tools/adb -s ENU7N15A30000390 shell getprop
    [  +64 ms] ro.hardware = angler
    [        ] ro.build.characteristics = nosdcard
    [   +2 ms] [✓] Connected devices
    [        ]     • Nexus 6P • ENU7N15A30000390 • android-arm • Android 8.1.0 (API 27)
    [  +14 ms] "flutter doctor" took 1,664ms.
    [ +100 ms] ensureAnalyticsSent: 98ms
    [   +2 ms] exiting with code 0`
    
  15. mit-mit commented on Feb 8, 2018

    @mit-mit
    Member

    @linguowu given the output of the ECHO commands you have is empty it looks like those variable were not correctly exported/set. You need to make sure they are set before running the flutter command. See https://github.com/flutter/flutter/wiki/Using-Flutter-in-China for details.

  16. InMatrix commented on Feb 8, 2018

    @InMatrix

    @linguowu In addition to what @mit-mit said, you can persist these environment variables by adding these export commands to $HOME/.bash_profile and then source $HOME/.bash_profile.

  17. hphpwj commented on Feb 28, 2018

    @hphpwj

    D:\flutter\flutter>flutter doctor
    Updating flutter tool...
    Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds...

    Waiting for 0 seconds, press CTRL+C to quit ...
    Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds...

    Waiting for 3 seconds, press CTRL+C to quit ...
    Terminate batch job (Y/N)? y

    and the environment variables is added:
    D:\flutter\flutter>echo %FLUTTER_STORAGE_BASE_URL%
    https://storage.flutter-io.cn

    D:\flutter\flutter>echo %PUB_HOSTED_URL%
    https://pub.flutter-io.cn

  18. a1265137718 commented on Mar 11, 2018

    @a1265137718
    1. checkout fluter by this way : https://github.com/flutter/flutter/wiki/Using-Flutter-in-China
      2 .then try to excute : C:\flutterdev\flutter\bin\flutter.bat
      i sovled my problem
  19. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    on Apr 23, 2018
  20. zoechi commented on Jan 17, 2019

    @zoechi
    Contributor

    Duplicate of #12301

  21. tarisham commented on Aug 11, 2019

    @tarisham

    hi
    go to the bios and change vm (Virtual machine) from disable to enable. you want to run emulator so its Necessary.

  22. github-actions commented on Aug 16, 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.

  23. locked as resolved and limited conversation to collaborators on Aug 16, 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

    a: first hourThe first hour of using Fluttert: flutter doctorProblem related to the "flutter doctor" tooltoolAffects 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