Reputation: 83
When running a new application "flutter pub get" in Vscode keeps running without completion.I have tried flutter clean , and reopening vscode.
Upvotes: 8
Views: 17511
Reputation: 1
Add Flutter to your firewall rules (System Settings/Network/Firewall/Options...) by enabling incoming connections, it's not perfect but it works for me (I'm on MacOS Sequoia).
Upvotes: 0
Reputation: 23
just use different internet, for my case, i used my phone's data mobile hotpost to fix it.
Upvotes: 0
Reputation: 1019
Try flutter clean
command, remove pubspec.lock
file in root directory then re-run flutter pub get
.
Upvotes: 14
Reputation: 11
for some reason, the default endpoint takes too much time to respond so changing the pub. dev endpoint might help
edit ~/.bashrc
or ~/.zshrc
based on your shell
export PUB_HOSTED_URL="https://pub.flutter-io.cn"
export FLUTTER_STORAGE_BASE_URL="https://storage.flutter-io.cn"
run source ~/.bashrc
or source ~/.zshrc
to apply the changes to the current terminal window.
name | value |
---|---|
PUB_HOSTED_URL | https://pub.flutter-io.cn |
FLUTTER_STORAGE_BASE_URL | https://storage.flutter-io.cn |
Code got from MathiasGodwin on Grepper
Upvotes: 0
Reputation: 959
I connected via VPN. And run flutter pub get. It fixed my issue.
Upvotes: 0
Reputation: 11
Step 1: flutter clean step 2: remove pubspec.lock step 3: If your project has lots of dependencies then load 1 or 2 at once .
It can happen because of lots of dependencies and slow internet connection.
Upvotes: 1
Reputation: 423
I got the same issue and I resolved it by synchronizing date and hours of my computer. With an incorrect date, you can have some network issues.
(My computer's date was set to 'yesterday')
Upvotes: 0
Reputation: 66
While my normal internet connection took more than 15 minutes, I connected to vpn from a different country and tried flutter pub get
. It worked pretty fast.
Upvotes: 0
Reputation: 2060
I was facing same issue, I checked all package names, they were correct. I did run flutter clean
and then flutter pub get
and it's worked. Hope! this might be helpful if some one faces same issue as I was.
Upvotes: 4
Reputation: 1
Actually it would be the issue related to the network rules in your system. means issue is related to IT team. they will unblock your firewall or use network proxy to fix this issue.
Upvotes: 0
Reputation: 76
I think you have to check the proper package name. Maybe you misspelled the package name or else your internet is not working fine.
Upvotes: 5