Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Got socket error trying to find package cupertino_icons at https://pub.dartlang.org

Tags:

flutter

dart

Whenever i try to create a new project in flutter through git bash or command prompt, i keep on getting this error Got socket error trying to find package cupertino_icons at https://pub.dartlang.org. I have upgraded the flutter sdk to the latest version but still the same problem. Please how do i solve this issue. Thanks

like image 222
Emmanuel Okocha Avatar asked Sep 04 '18 03:09

Emmanuel Okocha


2 Answers

I would advice anyone that might still be having this problem to TRY the following simply steps:

  1. open environment variable settings
  2. create a new variable with the name: PUB_HOSTED_URL and its value: https://pub.flutter-io.cn
  3. create a new variable with the name: FLUTTER_STORAGE_BASE_URL and its value: https://storage.flutter-io.cn

This did it for me. After spending weeks tryna figure it out. Would love to save someone the headache i went through.

like image 115
Oluwaseyitan Baderinwa Avatar answered Nov 20 '22 19:11

Oluwaseyitan Baderinwa


Spent 2 hours on it myself, in addition to the previous settings, check your antivirus, mine automatically blocked flutter, so disable your antivirus completely it and then try running again, hope this helps someone.

like image 1
boutonz Avatar answered Nov 20 '22 19:11

boutonz