score:-1
I had the same problem. I tried so hard to solve it, and I finally found the solution in this page: Flutter pub.get stopped working, even on vanilla install : socket error trying to find package xxx
It is because of the antivirus (which is SOPHOS I use with my Mac). I uninstalled it and it works perfectly
score:0
You need to correctly set up your flutter path.
from here https://flutter.dev/docs/get-started/install/macos#update-your-path
Determine the directory where you placed the Flutter SDK. You will need this in Step 3. Open (or create) $HOME/.bash_profile. You can do that by using terminal text editor by going in terminal and typing nano ~/.bash_profile macOS Catalina uses the Z shell by default, so edit $HOME/.zshrc.
If you are using a different shell, the file path and filename will be different on your machine.
Add the following line and change [PATH_TO_FLUTTER_GIT_DIRECTORY] to be the path where you cloned Flutter’s git repo: export PATH=[PATH_TO_FLUTTER_GIT_DIRECTORY]/flutter/bin:$PATH
for example:
export PATH=~/Documents/flutter/bin:$PATH
press CTRL X and when it asked you to save the file, choose yes
Run source $HOME/.bash_profile to refresh the current window or restart the terminal
Verify that the flutter/bin directory is now in your PATH by running: echo $PATH
Notice that [PATH_TO_FLUTTER_GIT_DIRECTORY] is where you installed flutter SDK, not the location of your app
Instead of nano, you can use any text editor to edit ~/.bash_profile
Source: stackoverflow.com
Related Query
- Flutter 2.0 giving pub get failed(server unavailable) on mac running BigSur
- i get "Error running 'main.dart': Entrypoint isn't within a Flutter pub root" every time i try to run my app
- Shared preferences in flutter giving error on pub get
- Flutter pub get running in wrong directory?
- Flutter: Running flutter pub get in github actions with private dependencies
- Flutter provider installation error while running pub get
- Flutter / Docker : problem running flutter pub get in docker file. Error: No pubspec.yaml file found
- Flutter / Docker : problem running flutter pub get in docker file. Error: No pubspec.yaml file found
- Flutter Get Device MAC Address
- Why is flutter pub get not finding my ssh-key for github?
- Flutter 2.0 upgrade, pub get failed with nonsense dependency behavior
- WARN: Unable to load JNA library (OS: Mac OS X 12.2) warning when running flutter app on release mode. (M1 Mac)
- Flutter :How to solve flutter_svg pub get failed error?
- flutter pub get is stucking
- Running Pub Upgrade in flutter installation taking too much time
- When I try running my flutter code on an iOS simulator for an app I'm developing, I get ERROR RUNNING POD INSTALL
- Error installing, running Fastlane for Flutter on mac
- flutter http get - why do I get "Invalid request method" when accessing a server running on NodeMCU?
- Hive Generator causes error in pubspec.yaml pub get in Flutter
- Flutter version solving failed on google_maps_flutter while running "flutter pub get"
- Flutter pub get takes too long to execute
- How do I get a Flutter project running on MacOS to successfully use Firestore?
- Version solving failing on running "flutter pub get" for Riverpod with the new Flutter 2.2.2 verison
- Flutter pub get failed with intl
- I am wondering how to use pub get and package download when using the internal network in Flutter
- How to get a unique identifier for a device running a flutter web app?
- Flutter Riverpod: pub get failed
- Error Running Flutter App on iOS after moving to M1 Mac
- Error running Flutter Doctor on M1 Mac - Unable to find bundled Java version
- Mac m1 flutter project not running on Android device or emulator
More Query from same tag
- flutter speech_to_text example SpeechRecognitionError
- Error UTF-8 pod install & Phared Preferences iOS Flutter
- How to convert this code in stateful widget using scaffold?
- 'codeAutoRetrievalTimeout != null': is not true
- Getting RefreshIndicator to work with SingleChildScrollable
- Flutter web vertical tab navigation
- Flutter Separating logic from UI Without Context
- flutter plugin for running onnx model
- Flutter async method slowdown app performance
- fetch data from excel to Datatable flutter
- Flutter with provider pattern: How and where to get async data
- How do I track Flutter screens in Firebase analytics?
- Flutter Google Sign In idToken expired
- Flutter change drawer header image at runtime
- Avoid user Login with Firebase on Creation
- Extend a Widget called from another file
- How to make multiple themed apps from one flutter project?
- My project requires a newer version of the Kotlin Gradle plugin, but the suggested fix doesn't work
- Flutter Deserialize a JSON and save it locally
- How can I draw a list with lines in Flutter
- Flutter 3D Design Page Implementation
- Firestore Sharing data with other users
- Flutter listview builder Scroll controller listener not firing inside list view?
- How do i make my text move to a new line if the text is very long
- flutter Error: The method '[]' was called on null. Receiver: null Tried calling: []("product")
- Check if an operator is defined for the object in dart
- Undefined class datetime in flutter
- Caching Image on flutter web, is it required?
- Debug flutter on iphone using VS Code on windows 10
- Format datePicker Header - Flutter