Getting error for installation of Flutter - flutter

I'm new to flutter and trying to install it by following a video on youtube.
But I'm getting error and cannot proceed.
I'm getting this error,
"Because flutter_tools depends on pubspec_parse 0.1.5 which doesn't
match any versions, version solving failed. Error: Unable to 'pub
upgrade' flutter tool. Retrying in five seconds... (9 tries left)"
Here's what I have done.
vim .bash_profile
changed the path to "export PATH="$PATH:[PATH_TO_FLUTTER_GIT_DIRECTORY]/flutter/bin" (I changed the[PATH_TO_FLUTTER_GIT_DIRECTORY] to my path, something like "user/name/ ... developer/. Also I press I key to insert them. If you know how to fix it, please let me know. I searched on Google but couldn't figure out the solution.

Related

How to solve the error on outdated code when cloning

I am recently want to see and run some other developers code in github and clone it to run in my emulator but it showing some error like this
"Running "flutter pub get" in budgex...
Because budgex depends on basic_utils from path which doesn't exist (could not find package basic_utils at "..\packages\basic-utils-3.3.3"), version solving failed.
pub get failed (66; Because budgex depends on basic_utils from path which doesn't exist (could not find package basic_utils at "..\packages\basic-utils-3.3.3"), version solving failed.)"
i am was trying to install basic_utils package but seem failed how to solve this problem?
Click on the link to get packages in the given environment like VS code, or save your code while pubspec.yaml file is opened – it will get flutter packages for you automatically.
The error says that you are trying to use a library on your local computer: basic_utils; the pub command is searching it in the path ..\packages\basic-utils-3.3.3 but it can't find the library there.
In the pubspec.yaml you should have something like this:
basic_utils:
path: ..\packages\basic-utils-3.3.3
You should be ok replacing this with:
basic_utils: 3.3.3
If the developer has made changes to the library you should ask him the changed library and then update the pubspec with the correct location like described here.

Flutter simply showing 'sysctl -n hw.optional.arm64' returned unexpected output: ''

Not sure which details are relevant so I'll include as many as possible.
Had to upgrade flutter today and instead of working when I typed in 'flutter upgrade' into android studios terminal/Iterm2/terminal zsh I was met with the following response.
'sysctl -n hw.optional.arm64' returned unexpected output: ''
When I search for this issue the only thing i can find is this post which states that sysctl can't be found. The path does appear to be in my .zshrc but still not working. I can't use which or where sysctl as it just says 'sysctl not found'
When I try to upgrade flutter through brew (brew install --cask flutter) it downloads fine but on installing it throws the following error:
==> Purging files for version 3.3.5 of Cask flutter
Error: It seems there is already a Binary at '/opt/homebrew/bin/dart'.
I can't continue working as I need the new flutter version and it seems the web doesn't have much to show for this particular error.
I can't flutter --version, flutter doctor or anything of the sort as I just get the same message.
I'm using:
MacOS monterey 12.6 macbook air.
Android studios
Iterm2
Ohmyzsh
When I open android studios it shows me the following:
"Flutter device daemon #1 exited (exit code 1), stderr: 'sysctl -n hw.optional.arm64' returned unexpected output: '' in a pop up window.
Pubspec has been edited > get dependencies > Upgrade depenedencies: Both of which have the same error as in the title.
The current configured flutter SDK is not known to be fully supported. Please update your SDK and restart intelliJ which I think is what I've been trying to do.
This is an answer I hope will be helpful for others who have the same issue.
Other answers suggested a fix by just updating the path document (.zshrc) but this is what helped me as that did not and my paths were up to date.
Sadly, it's as simple as manually deleting all my flutter SDK files locally. Downloading them again (this time the latest one) and unzipping it into the same place. Didn't even have to update the path).
Worked a charm, issues appear to be all gone except that the dialogue in android studios is still saying that there are dependencies that need getting and upgrading (but doesn't go away even when I've run it).
I solved it by removing the old flutter SDK, downloading the latest version, and setting it up again.
it works perfectly for me!

Can't run any Flutter Command because Flutter fails to update Flutter Tool

When I try to run any Flutter Command, it gives me this error:
The system could not find the path specified
Error (1): Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (9 tries left)
After that, it waits 5 Seconds and loops. To end the loop it tells me to press CTRL + C.
I've been looking for the solution all day, I've tried the following things:
Reinstalling Flutter, Dart and Android Studio
Adding Flutter to the path
Deleting the cache folder
Disabling Antivirus
Running D:\Flutter\flutter\bin\cache\dart-sdk\bin\pub.bat upgrade --verbosity=error --no-packages-dir in D:\Flutter\flutter\packages\flutter_tools>
Everything didn't work.
As Mentioned, my Flutter SDK path is D:\Flutter\flutter
I installed flutter, dart and the app on my C:\ Drive and it worked for me!

Unable to run flutter commands

When I had previously setup flutter, all was working well, however, now all of the flutter commands are resulting in this error:
Error: Error when reading '../../../../documents/flutter/bin/cache/dart-sdk/bin/snapshots/pub.dart.snapshot': No such file or directory
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (1 tries left)
Command 'pub upgrade' still failed after 10 tries, giving up.```
How do I solve this?
Looks like something went wrong while downloading the dart sdk. Can you delete the cache folder inside bin and then run flutter doctor again? What's the output?
Are you by any chance behind a firewall (or using a proxy) that might be blocking the download of the dart sdk?

Unable to create flutter project

When running flutter create followed by project name, I receive this error:
Error: Error when reading '../documents/flutter/bin/cache/dart-sdk/bin/snapshots/pub.dart.snapshot': No such file or directory
Running "flutter pub get" in pics...
pub get failed (254; Error: Error when reading
'../documents/flutter/bin/cache/dart-sdk/bin/snapshots/pub.dart.snapshot': No
such file or directory)
I'm trying to create a new flutter project in xcode. How would I fix this?
'../documents/flutter/bin/cache/dart-sdk/bin/snapshots/pub.dart.snapshot': No
such file or directory
It seems like there may be files missing from your Flutter SDK. There should be a file in the Flutter SDK at bin/cache/dart-sdk/bin/snapshots/pub.dart.snapshot but this error suggests it's missing.
The easiest fix may be to delete the bin/cache folder which will cause Flutter to re-download the Dart SDK and other components when you next run flutter. This may take a little while depending on your connection, but is the simplest way to ensure the cache folder is complete. I would suggest closing all IDEs/editors when doing this.
I have same issue but the problem was windows defender at real time detection so the solution was to switch off it then create a project...