Problems running flutter doctor - flutter

I recently downloaded flutter and other related apps to my pc.I am however unable to run flutter doctor on the terminal.I am also unable to create a new flutter project on android studoi. Each time I try to do any of the above , I get the error
C:\WINDOWS\system32>flutter doctor
Cannot open file, path = 'pubspec.lock' (OS Error: The parameter is incorrect.
, errno = 87)
Running "flutter pub get" in flutter_tools...
pub get failed (66; , errno = 87))
C:\Windows\System32>
I have tried updating the path in my environment variables but that failed. Please help.

Related

Could not find a file named "pubspec.yaml"

hi friends how to solve this error,i'm just running this command flutter:
Flutter doctor -v,
flutter pub cache clean ,
flutter pub cache repair,
flutter packages pub get,
flutter clean,
dart pub get ,
flutter pub get,
i'm getting an error
Could not find a file named "pubspec.yaml" in "E:\flutter.pub-cache\hosted\pub.dartlang.org\test_api-0.4.8".
Running "flutter pub get" in flutter_tools...
pub get failed (66; Could not find a file named "pubspec.yaml" in
"E:\flutter.pub-cache\hosted\pub.dartlang.org\test_api-0.4.8".)
I had this same issue. Really frustrating.I deleted the pub.dartlang.org folder.
On Mac, in finder command + shift + G | pasted the path from the console | opened in finder and removed the folder.
after deleting the folder
run
Pub get
pub outdated / upgrade
pod repo update
pod update
This fixed my issue and allowed me to build the app.

flutter pub get not working after updating flutter 2.5

Hy hope so all are good and fine! i am new to flutter and after updating flutter version to 2.5 i am facing this type of errors as in images below enter image description here
enter image description here
Error is:
flutter pub get
Could not resolve URL "https://pub.dartlang.org".
pub get failed (server unavailable) -- attempting retry 1 in 1 second...
Could not resolve URL "https://pub.dartlang.org".
pub get failed (server unavailable) -- attempting retry 2 in 2 seconds...
Running "flutter pub get" in flutter_application_1...
Just accept android licenses to the run below command on terminal, I also face this problem when I upgrading my flutter and I have solve my issue on below command, hope its help to you
flutter doctor --android-licenses
And accept the terms on the terminal

FLUTTER - Oops; flutter has exited unexpectedly: "FileSystemException: Deletion failed, path = '...\.ios' )

Flutter IOS directory has been accidentally deleted
Oops; flutter has exited unexpectedly: "FileSystemException: Deletion failed, path = 'C:\Users\USER\AndroidStudioProjects\flutter_project\.ios' (OS Error: The directory is not empty. , errno = 145)".
The solution to this problem is below.
THE SOLUTION IS:
RUN THE COMMAND BELOW IN YOUR FLUTTER PROJECT
1. flutter clean
2. flutter pub get
AND ERROR WILL BE GONE

I add audioplayers 0.19.1 package from pub dev but when I run pub get, I face the Error , Cannot create link, I don't know what happened

Here is the Error I face
Cannot create link, path = 'C:\flutter\.pub cache\_temp\dir627f91b4\ios\Classes\AudioplayersPlugin.h' (OS Error: A required privilege is not held by the client.
, errno = 1314)
pub get failed (66; , errno = 1314))
This problem happens for permission issue. So you just need to run Command Prompt in administrator and then type
cd folderpath
after that you can run pub get
pub get
This will be fix your problem
running "vs code" (or what ever the IDE you use). run as admin solved my problem. and do what you always do in the terminal run command: flutter pub get
Audioplayers have been depricated use just_audio

flutter 'file not found' during build for ios

I'm trying to use the image_picker_web package,(https://pub.dev/packages/image_picker_web) and have put:
image_picker_web: ^1.0.9
in my pubspec.yaml file.
When I try building my project for iOS, I get the following error:
[ios/.symlinks/plugins/image_picker_web/example] flutter pub get
Running "flutter pub get" in example...
Cannot open file, path = '/Users/username/.pub-cache/global_packages/image_picker_web_example/pubspec.lock' (OS Error: No such file or directory, errno = 2)
pub get failed (66; Cannot open file, path = '/Users/username/.pub-cache/global_packages/image_picker_web_example/pubspec.lock' (OS Error: No such file or directory, errno = 2))
exit code 66
With no other code in the project that uses that package, I get the same error. The only way to avoid it is to comment out image_picker_web: ^1.0.9 in my pubspec.yaml and run 'flutter pub get'
I created an issue in their git repo, under the assumption that it's a bug. Is this the case? Are there any workarounds? (perhaps ignoring a package when building for a different platform?)
I ran the following command to fix a similar issue.
Remove all existing caches
sudo rm -rf ~/.pub-cache
Repair the cache
flutter pub cache repair
Reinstall the dependencies
flutter packages get