Pub get failed (server unavailable) when building a new project
Got TLS error trying to find package launch_review at https://pub.dartlang.org.
pub get failed (server unavailable) -- attempting retry 1 in 1 second...
Got socket error trying to find package launch_review at https://pub.dartlang.org.
pub get failed (server unavailable) -- attempting retry 2 in 2 seconds...
Got TLS error trying to find package launch_review at https://pub.dartlang.org.
pub get failed (server unavailable) -- attempting retry 3 in 4 seconds...
Got socket error trying to find package launch_review at https://pub.dartlang.org.
pub get failed (server unavailable) -- attempting retry 4 in 8 seconds...
Quick fixes before explanation:
Restart your router! Works for me several times.
Make sure your network is not behind a proxy
Make sure you can ping to pub.dev without any packet loss
Try to close all of your dart.exe processes before retying to perform the flutter pub get
Try to delete an existing package from your pubspec.yaml and re-get it to see if it works
Try to manually add the package to your project
So, I had (and sometime still having) the same issue. I've analyzed it and came to a conclusion that the package download manager and the server that hosts those packages aren't reliabe at all. Very small packages might just successfully be imported with "flutter pub get", whereas big ones might last forever to download. This is definately a networking issue, on either yours or their side.
Just for verificatioin that we are indeed experiencing the same issue:
open your cmd (no matter t OS) and run: ping -t pub.dev .Now
Open up your task manager and look for the latest dart.exe task (it should be invoked the moment you flutter pub get. This task is the package that is being downloaded. If you see the process size never exceeding a certain size, and the get command is still stuck, it only indicates a network issue and the package might never be downloaded successfully. For example, my attempts to get the carousela_flutter 1.4.1 package ended up with a halted process size of around 60mb, looks this this:
If you wait for a relatively large amount of time (10 minutes I would say is enough) and the connectivity issue is still not resolved, you will see the following msg from flutter: "Process finished with exit code 0".
I suggest you try another time or maually add the package.
p.s: it doesn't happen with all of the packages and from my investigation is seems to be related to the size of it. e.g, I managed to get the carousela_flutter 0.7.0 package, but the 1.4.1 failed.
发布失败(服务器不可用)-尝试在 1 秒内重试 1 次...颤振错误
pub get falló (servidor no disponible) -- intentando reintentar 1 en 1 segundo... error de aleteo
पब विफल हो गया (सर्वर अनुपलब्ध) - 1 सेकंड में 1 पुनः प्रयास करने का प्रयास ... स्पंदन त्रुटि
pub get failed (serveur indisponible) - tentative de nouvelle tentative 1 en 1 seconde... erreur flottante
pub get 실패(서버 사용 불가) -- 1초에 1번 재시도 중... 플러터 오류
pub get failed(server available)-1秒に1回再試行しようとしています...フラッターエラー
pub muvaffaqiyatsiz tugadi (server mavjud emas) -- 1 soniyada 1 marta qayta urinish... chayqalish xatosi
nabigo ang pub (hindi available ang server) -- sinusubukang muling subukan 1 sa 1 segundo... flutter error
فشل pub (الخادم غير متوفر) - محاولة إعادة المحاولة 1 في 1 ثانية ... خطأ رفرفة
pub получить не удалось (сервер недоступен) -- попытка повтора 1 за 1 секунду ... флаттер ошибка
pub başarısız oldu (sunucu kullanılamıyor) -- 1 saniyede 1 yeniden deneniyor... çarpıntı hatası
pub не працює (сервер недоступний) -- повторна спроба 1 на 1 секунду... помилка тріпотіння
#china #flutter #vpn #firewall #fail #server #unavailable #error #coding #mobileapp #blacko #blacksherif #traveller