Got socket error trying to find package flutter_lints at https://pub.dev

48 Views Asked by At

I've been creating Flutter projects without any issues until recently. However, when I attempt to create a new Flutter project in Visual Studio Code, I encounter the following error: "[chatgpt_storygenerator] flutter create --template app --overwrite . Waiting for another flutter command to release the startup lock... Creating project .... Resolving dependencies... Got socket error trying to find package flutter_lints at https://pub.dev. exit code 69"

Fortunately, the issue is resolved by running flutter pub get, but I'm curious as to why this error occurs in the first place. Can anyone shed light on why this error is happening and if there's a more permanent solution to it?

1

There are 1 best solutions below

0
AngDrew On

sometimes when you can't connect to the server it's most likely that the internet provider can't reach the server. so, in my cases usually i will change my DNS (using cloudflare 1.1.1.1 or google DNS), and the issue solved. when the issue still occuring (usually when you have issue with podfile) you have to update the pod or upgrade or even re-install it.