Skip to content

Ubuntu 18.04 : Error: Unable to 'pub upgrade' flutter tool. #25068

@SunLongbri

Description

@SunLongbri

Steps to Reproduce

export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
git clone -b dev https://github.com/flutter/flutter.git
export PATH="$PWD/flutter/bin:$PATH"
cd ./flutter
  1. ...In the terminal , I input flutter .....
  2. ...At the start,flutter is downing sdk ,and when download complete , output this error.

Logs

heaven@Heaven-Code-Master:~/Development$ flutter
Downloading Dart SDK from Flutter engine 7375a0f414bde4bc941e623482221db2fc8c4ab5...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 49.3M  100 49.3M    0     0  2680k      0  0:00:18  0:00:18 --:--:-- 3053k
Building flutter tool...
-------------------Error will encounter -------------------------------
The setter 'readEventsEnabled=' was called on null.
Receiver: null
Tried calling: readEventsEnabled=false
package:pub/src/source/hosted.dart 341:7                                                      BoundHostedSource._throwFriendlyError
package:pub/src/source/hosted.dart 142:7                                                      BoundHostedSource.doGetVersions
===== asynchronous gap ===========================
package:pub/src/source.dart 167:12                                                            BoundSource.getVersions
package:pub/src/solver/package_lister.dart 76:44                                              PackageLister._versions.<fn>.<fn>
dart:async                                                                                    runZoned
package:pub/src/http.dart 272:10                                                              withDependencyType
package:pub/src/solver/package_lister.dart 75:33                                              PackageLister._versions.<fn>
===== asynchronous gap ===========================
dart:async                                                                                    new Future.sync
package:async/src/async_memoizer.dart 43:42                                                   AsyncMemoizer.runOnce
package:pub/src/solver/package_lister.dart 74:58                                              PackageLister._versions
package:pub/src/solver/package_lister.dart 111:21                                             PackageLister.countVersions
===== asynchronous gap ===========================
package:pub/src/solver/version_solver.dart 354:44                                             VersionSolver._choosePackageVersion.<fn>
===== asynchronous gap ===========================
package:pub/src/utils.dart 301:39                                                             minByAsync
===== asynchronous gap ===========================
package:pub/src/solver/version_solver.dart 350:25                                             VersionSolver._choosePackageVersion
===== asynchronous gap ===========================
package:pub/src/solver/version_solver.dart 97:22                                              VersionSolver.solve
===== asynchronous gap ===========================
package:pub/src/solver.dart 35:10                                                             resolveVersions.<fn>
package:pub/src/log.dart 378:18                                                               progress
package:pub/src/solver.dart 32:10                                                             resolveVersions
package:pub/src/entrypoint.dart 200:24                                                        Entrypoint.acquireDependencies
===== asynchronous gap ===========================
package:pub/src/command/upgrade.dart 43:22                                                    UpgradeCommand.run
===== asynchronous gap ===========================
package:args/command_runner.dart 194:27                                                       CommandRunner.runCommand
===== asynchronous gap ===========================
package:pub/src/command_runner.dart 168:39                                                    PubCommandRunner.runCommand.<fn>
dart:async                                                                                    new Future.sync
package:pub/src/utils.dart 109:12                                                             captureErrors.<fn>
dart:async                                                                                    runZoned
package:pub/src/utils.dart 126:5                                                              captureErrors
package:pub/src/command_runner.dart 168:13                                                    PubCommandRunner.runCommand
===== asynchronous gap ===========================
package:pub/src/command_runner.dart 117:11                                                    PubCommandRunner.run
===== asynchronous gap ===========================
/b/build/slave/Linux_Engine/build/src/third_party/dart/third_party/pkg/pub/bin/pub.dart 8:22  main
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... (9 tries left)

Activity

added
toolAffects the "flutter" command-line tool. See also t: labels.
a: chinaChina and its Great Firewall
on Dec 7, 2018
added this to the Goals milestone on Dec 7, 2018
SunLongbri

SunLongbri commented on Dec 7, 2018

@SunLongbri
Author

How should I do ?

SunLongbri

SunLongbri commented on Dec 7, 2018

@SunLongbri
Author

I think the reason is :pub enrivonment is not ready , but I don't what to do that make the environment of pub is ready.The computer system I used is Ubuntu 18.04.1LTS.

zoechi

zoechi commented on Dec 7, 2018

@zoechi
Contributor

I don't think there is such a thing as an pub environment that needs to get ready.

Could you try to open https://pub.flutter-io.cn/api/packages in the browser and check if you get JSON response back (several pages long)?

SunLongbri

SunLongbri commented on Dec 7, 2018

@SunLongbri
Author

Yes , I can get the Json from browser,and I get the Json is :
next_url | "https://pub.flutter-io.cn/api/packages?page=2"

SunLongbri

SunLongbri commented on Dec 7, 2018

@SunLongbri
Author

I can get lots of pages:I think my computer's network is good.

next_url | "https://pub.flutter-io.cn/api/packages?page=8"

SunLongbri

SunLongbri commented on Dec 7, 2018

@SunLongbri
Author

God , God , I like the language of flutter very much , I hope I can get help to resolve this problem.

SunLongbri

SunLongbri commented on Dec 7, 2018

@SunLongbri
Author

I already resolve this problems , the reason is that I use lantern . And in this way , my network crashed by VPN.

SunLongbri

SunLongbri commented on Dec 7, 2018

@SunLongbri
Author

Thought ,I resolved this problems ,but when I input the 'flutter doctor ',another problem encounter.

heaven@Heaven-Code-Master:~/Development/flutter$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel dev, v1.0.0, on Linux, locale en_US.UTF-8)
    ✗ Downloaded executables cannot execute on host.
      See https://github.com/flutter/flutter/issues/6207 for more information
      On Debian/Ubuntu/Mint: sudo apt-get install lib32stdc++6
      On Fedora: dnf install libstdc++.i686
      On Arch: pacman -S lib32-libstdc++5

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[✓] Android Studio (version 3.2)
[!] Connected device
    ! No devices available

! Doctor found issues in 2 categories.

When I input the order 'sudo apt-get install lib32stdc++6'
terminal encounter------>

The following packages have unmet dependencies:
 lib32stdc++6 : Depends: gcc-7-base (= 7.2.0-8ubuntu3.2) but 7.3.0-27ubuntu1~18.04 is to be installed
                Depends: lib32gcc1 (>= 1:4.2) but it is not going to be installed
                Depends: libc6-i386 (>= 2.18) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

My Computer System :Ubuntu 18.04 64 ,I think I can't install lib32stdc++6 ,because it's 32 .
I think is right?

FlyAwayL

FlyAwayL commented on Dec 10, 2018

@FlyAwayL
[!] Flutter (Channel dev, v1.0.0, on Linux, locale en_US.UTF-8)
    ✗ Downloaded executables cannot execute on host.

Maybe you can download Flutter sdk again.

git clone -b dev https://github.com/flutter/flutter.git
zoechi

zoechi commented on Dec 28, 2018

@zoechi
Contributor

Related to #10335

zoechi

zoechi commented on Jan 17, 2019

@zoechi
Contributor

Duplicate of #12301

github-actions

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

locked as resolved and limited conversation to collaborators on Aug 14, 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: chinaChina and its Great Firewallplatform-linuxBuilding on or for Linux specificallytoolAffects 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

        Participants

        @zoechi@FlyAwayL@SunLongbri

        Issue actions

          Ubuntu 18.04 : Error: Unable to 'pub upgrade' flutter tool. · Issue #25068 · flutter/flutter