"flutter pub get" can't get dependency plugins

Md Mahmudul Islam picture Md Mahmudul Islam · Mar 29, 2020 · Viewed 12.5k times · Source

I've been trying to get dependencies for my Flutter project on Windows but it's taking a long time and after a while , it shows this error in 'messages' bar.

Running "flutter pub get" in badhan_blood_bank...               
OS Error: The semaphore timeout period has expired.

, errno = 121, address = storage.googleapis.com, port = 53515

pub get failed (server unavailable) -- attempting retry 1 in 1 second...

I am trying to solve this problem some ways but failed to solve. I am doing flutter clean, flutter upgrade and restart android studio at the end same problem happen.

It was working fine before I add url_launcher inside the dependencies in my project.

Here is my pubspec.yaml file:

version: 1.0.0+1

environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^0.1.2
  firebase_auth: ^0.15.5+2
  flutter_facebook_login: ^3.0.0
  flutter_icons: ^1.0.0+1
  flutter_spinkit: ^4.1.2
  firebase_database: ^3.1.3
  google_maps_flutter: ^0.5.25
  geolocator: ^5.3.0
  intl: ^0.16.1
  curved_navigation_bar: ^0.3.2
  fluttertoast: ^4.0.1
  url_launcher: ^5.4.2



dev_dependencies:
  flutter_test:
    sdk: flutter

flutter:
  uses-material-design: true

  assets:
  - images/


After running "flutter pub get --verbose" shows:

[  +27 ms] executing: [C:\src\flutter\flutter\] git -c log.showSignature=false log -n 1 --pretty=format:%H
[  +64 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[        ] 0b8abb4724aa590dd0f429683339b1e045a1594d
[        ] executing: [C:\src\flutter\flutter\] git describe --match v*.*.* --first-parent --long --tags
[  +56 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long --tags
[        ] v1.12.13+hotfix.8-0-g0b8abb472
[   +7 ms] executing: [C:\src\flutter\flutter\] git rev-parse --abbrev-ref --symbolic @{u}
[  +41 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/stable
[        ] executing: [C:\src\flutter\flutter\] git ls-remote --get-url origin
[  +38 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[  +77 ms] executing: [C:\src\flutter\flutter\] git rev-parse --abbrev-ref HEAD
[  +41 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] stable
[  +48 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +4 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +130 ms] Running "flutter pub get" in badhan_blood_bank...
[   +5 ms] Using C:\src\flutter\flutter\.pub-cache for the pub cache.
[   +1 ms] executing: [D:\@@MyWorks\mahmud\Badhan Blood Bank\badhan_blood_bank\] C:\src\flutter\flutter\bin\cache\dart-sdk\bin\pub.bat --verbose get
--no-precompile
[ +157 ms] FINE: Pub 2.7.0
[   +3 ms] IO  : Spawning "cmd /c ver" in D:\@@MyWorks\mahmud\Badhan Blood Bank\badhan_blood_bank\.
[   +7 ms] IO  : Finished ver. Exit code 0.
[   +1 ms]     | stdout:
[        ]     | | 
[   +1 ms]     | | Microsoft Windows [Version 10.0.18362.720]
[   +1 ms]     | Nothing output on stderr.
[ +102 ms] MSG : Resolving dependencies...
[   +9 ms] SLVR: fact: badhanbloodbank is 1.0.0+1
[   +5 ms] SLVR: derived: badhanbloodbank
[  +61 ms] SLVR: fact: badhanbloodbank depends on flutter any from sdk
[   +1 ms] SLVR: fact: badhanbloodbank depends on cupertino_icons ^0.1.2
[   +1 ms] SLVR: fact: badhanbloodbank depends on firebase_auth ^0.15.5+2
[   +1 ms] SLVR: fact: badhanbloodbank depends on flutter_facebook_login ^3.0.0
[   +1 ms] SLVR: fact: badhanbloodbank depends on flutter_icons ^1.0.0+1
[   +1 ms] SLVR: fact: badhanbloodbank depends on flutter_spinkit ^4.1.2
[        ] SLVR: fact: badhanbloodbank depends on firebase_database ^3.1.3
[        ] SLVR: fact: badhanbloodbank depends on google_maps_flutter ^0.5.25
[        ] SLVR: fact: badhanbloodbank depends on geolocator ^5.3.0
[        ] SLVR: fact: badhanbloodbank depends on intl ^0.16.1
[        ] SLVR: fact: badhanbloodbank depends on curved_navigation_bar ^0.3.2
[        ] SLVR: fact: badhanbloodbank depends on fluttertoast ^4.0.1
[        ] SLVR: fact: badhanbloodbank depends on url_launcher ^5.4.2
[        ] SLVR: fact: badhanbloodbank depends on flutter_test any from sdk
[        ] SLVR:   selecting badhanbloodbank
[        ] SLVR:   derived: flutter_test any from sdk
[        ] SLVR:   derived: url_launcher ^5.4.2
[   +1 ms] SLVR:   derived: fluttertoast ^4.0.1
[   +1 ms] SLVR:   derived: curved_navigation_bar ^0.3.2
[        ] SLVR:   derived: intl ^0.16.1
[   +1 ms] SLVR:   derived: geolocator ^5.3.0
[   +1 ms] SLVR:   derived: google_maps_flutter ^0.5.25
[   +1 ms] SLVR:   derived: firebase_database ^3.1.3
[        ] SLVR:   derived: flutter_spinkit ^4.1.2
[        ] SLVR:   derived: flutter_icons ^1.0.0+1
[        ] SLVR:   derived: flutter_facebook_login ^3.0.0
[        ] SLVR:   derived: firebase_auth ^0.15.5+2
[        ] SLVR:   derived: cupertino_icons ^0.1.2
[        ] SLVR:   derived: flutter any from sdk
[        ] IO  : Get versions from https://pub.dartlang.org/api/packages/url_launcher.
[   +9 ms] IO  : HTTP GET https://pub.dartlang.org/api/packages/url_launcher
[   +2 ms]     | Accept: application/vnd.pub.v2+json
[   +1 ms]     | X-Pub-OS: windows
[        ]     | X-Pub-Command: get
[        ]     | X-Pub-Session-ID: 795584D9-523C-4575-B686-2D496C324C5B
[        ]     | X-Pub-Environment: flutter_cli:get
[   +1 ms]     | X-Pub-Reason: direct
[        ]     | user-agent: Dart pub 2.7.0
[ +934 ms] IO  : HTTP response 200 OK for GET https://pub.dartlang.org/api/packages/url_launcher
[   +5 ms]     | took 0:00:00.938247
[   +2 ms]     | transfer-encoding: chunked
[   +2 ms]     | date: Sun, 29 Mar 2020 19:47:07 GMT
[   +2 ms]     | content-encoding: gzip
[   +2 ms]     | vary: Accept-Encoding
[   +3 ms]     | strict-transport-security: max-age=31536000; preload
[   +3 ms]     | via: 1.1 google
[   +2 ms]     | content-type: application/json
[   +2 ms]     | x-frame-options: SAMEORIGIN
[   +2 ms]     | x-xss-protection: 1; mode=block
[   +2 ms]     | x-content-type-options: nosniff
[   +2 ms]     | server: dart:io with Shelf
[  +66 ms] SLVR:   fact: flutter_test 0.0.0 from sdk depends on flutter any from sdk
[   +1 ms] SLVR:   fact: flutter_test 0.0.0 from sdk depends on test_api 0.2.11
[        ] SLVR:   fact: flutter_test 0.0.0 from sdk depends on path 1.6.4
[        ] SLVR:   fact: flutter_test 0.0.0 from sdk depends on image 2.1.4
[        ] SLVR:   fact: flutter_test 0.0.0 from sdk depends on quiver 2.0.5
[   +1 ms] SLVR:   fact: flutter_test 0.0.0 from sdk depends on stack_trace 1.9.3
[        ] SLVR:   fact: flutter_test 0.0.0 from sdk depends on vector_math 2.0.8
[        ] SLVR:   fact: flutter_test 0.0.0 from sdk depends on archive 2.0.11
[        ] SLVR:   fact: flutter_test 0.0.0 from sdk depends on args 1.5.2
[   +1 ms] SLVR:   fact: flutter_test 0.0.0 from sdk depends on async 2.4.0
[   +1 ms] SLVR:   fact: flutter_test 0.0.0 from sdk depends on boolean_selector 1.0.5
[        ] SLVR:   fact: flutter_test 0.0.0 from sdk depends on charcode 1.1.2
[   +1 ms] SLVR:   fact: flutter_test 0.0.0 from sdk depends on collection 1.14.11
[   +1 ms] SLVR:   fact: flutter_test 0.0.0 from sdk depends on convert 2.1.1
[        ] SLVR:   fact: flutter_test 0.0.0 from sdk depends on crypto 2.1.3
[        ] SLVR:   fact: flutter_test 0.0.0 from sdk depends on matcher 0.12.6
[   +2 ms] SLVR:   fact: flutter_test 0.0.0 from sdk depends on meta 1.1.8
[        ] SLVR:   fact: flutter_test 0.0.0 from sdk depends on pedantic 1.8.0+1
[        ] SLVR:   fact: flutter_test 0.0.0 from sdk depends on petitparser 2.4.0
[        ] SLVR:   fact: flutter_test 0.0.0 from sdk depends on source_span 1.5.5
[        ] SLVR:   fact: flutter_test 0.0.0 from sdk depends on stream_channel 2.0.0
[        ] SLVR:   fact: flutter_test 0.0.0 from sdk depends on string_scanner 1.0.5
[        ] SLVR:   fact: flutter_test 0.0.0 from sdk depends on term_glyph 1.1.0
[        ] SLVR:   fact: flutter_test 0.0.0 from sdk depends on typed_data 1.1.6
[   +1 ms] SLVR:   fact: flutter_test 0.0.0 from sdk depends on xml 3.5.0
[        ] SLVR:     selecting flutter_test 0.0.0 from sdk
[        ] SLVR:     derived: xml 3.5.0
[        ] SLVR:     derived: typed_data 1.1.6
[   +1 ms] SLVR:     derived: term_glyph 1.1.0
[        ] SLVR:     derived: string_scanner 1.0.5
[        ] SLVR:     derived: stream_channel 2.0.0
[   +2 ms] SLVR:     derived: source_span 1.5.5
[        ] SLVR:     derived: petitparser 2.4.0
[        ] SLVR:     derived: pedantic 1.8.0+1
[        ] SLVR:     derived: meta 1.1.8
[   +3 ms] SLVR:     derived: matcher 0.12.6
[        ] SLVR:     derived: crypto 2.1.3
[        ] SLVR:     derived: convert 2.1.1
[   +1 ms] SLVR:     derived: collection 1.14.11
[        ] SLVR:     derived: charcode 1.1.2
[        ] SLVR:     derived: boolean_selector 1.0.5
[        ] SLVR:     derived: async 2.4.0
[   +1 ms] SLVR:     derived: args 1.5.2
[   +4 ms] SLVR:     derived: archive 2.0.11
[   +1 ms] SLVR:     derived: vector_math 2.0.8
[   +4 ms] SLVR:     derived: stack_trace 1.9.3
[   +1 ms] SLVR:     derived: quiver 2.0.5
[        ] SLVR:     derived: image 2.1.4
[   +1 ms] SLVR:     derived: path 1.6.4
[   +1 ms] SLVR:     derived: test_api 0.2.11
[   +1 ms] SLVR:     fact: url_launcher >=3.0.0 depends on flutter any from sdk
[        ] SLVR:     fact: url_launcher >=5.4.0 depends on url_launcher_macos ^0.0.1
[   +1 ms] SLVR:     fact: url_launcher >=5.4.1 depends on url_launcher_platform_interface ^1.0.4
[   +1 ms] SLVR:     fact: url_launcher >=5.3.0 depends on url_launcher_web ^0.1.0+1
[   +1 ms] SLVR:       selecting url_launcher 5.4.2
[        ] SLVR:       derived: url_launcher_web ^0.1.0+1
[        ] SLVR:       derived: url_launcher_platform_interface ^1.0.4
[        ] SLVR:       derived: url_launcher_macos ^0.0.1
[   +1 ms] IO  : Get versions from https://pub.dartlang.org/api/packages/url_launcher_web.
[   +1 ms] IO  : HTTP GET https://pub.dartlang.org/api/packages/url_launcher_web
[        ]     | Accept: application/vnd.pub.v2+json
[        ]     | X-Pub-OS: windows
[        ]     | X-Pub-Command: get
[        ]     | X-Pub-Session-ID: 795584D9-523C-4575-B686-2D496C324C5B
[        ]     | X-Pub-Environment: flutter_cli:get
[        ]     | user-agent: Dart pub 2.7.0
[ +429 ms] IO  : HTTP response 200 OK for GET https://pub.dartlang.org/api/packages/url_launcher_web

What is the problem and how to solve it?

Answer

Shariful Islam Mubin picture Shariful Islam Mubin · Mar 30, 2020

From yesterday, there is some problem with storage.googleapis.com in Bangladesh.

First I thought this is maybe an issue with Google's Infrastructure.
But, after some time I realized that it's an issue with BTCL.

To overcome this issue, you can use a VPN tool and re-run your project.
I used Hotspot Sheild VPN and after that everything was good.

Remember that, the free version limit is 500 MB/Day

I hope this will also work for you.