Flutter command not working after running "flutter upgrade" - flutter

I recently tried running flutter upgrade and it seemed to run successfully. But after that the flutter command itself stopped working. Every time I try to run a flutter command it gives this error
'sysctl -n hw.optional.arm64' returned unexpected output: ''
I'm using a MacBook Pro with an Intel i7 processor.
I couldn't find anything on this error online. I also tried doing a git reset and a git pull on the flutter (core) directory. Nothing seems to help.
What could the issue be?

I managed to fix it. For some reason after upgrading flutter the path variable got messed up, at least in my .zshrc file. So I had to go and add the usr/sbin path to the PATH variable. That's where the sysctl program sits and that's why it was giving an error that the output is empty.
Hope this helps someone.

Related

I am now faced with repeated terminal problems. plz

I have a repeated terminal problem.
If i turn on the terminal and run the flutter doctor, it says command not found and it does not work.
So if i type [export PATH="$PATH:pwd/flutter/bin"] and enter the flutter doctor, it is worked
In addition, the flutter doctor was executed like this, but the version of cocoapods was low, causing continuous errors.
and then, i typeed [source ~/.zshrc] and [sudo gem install cocoapods]
I entered these and they work normally.
But I wonder if I have to go through these procedures every time I turn on the terminal.
I don't think this problem is a problem for me to run the flutter in vscode.
Can't I save the procedure I enter so that I don't find any errors when I run the flutter doctor right from the terminal?
If I can't do that, is there no problem using flutter in vscode even if I keep the current situation?
thank u
type [export PATH="$PATH:pwd/flutter/bin"]
type [source ~/.zshrc] and [sudo gem install cocoapods]
Try to do this:
Type: open ~/.zshrc
Edit inside your zshrc: PATH="$PATH:$HOME/development/flutter/bin". Well in my case, the flutter folder is in $HOME/development, replace this in your corresponding path.
Delete all of redundant other flutter/bin in zshrc.
Close your text edit & run source ~/.zshrc.
Exit your current terminal. If you are in vscode, close your terminal & exit vscode also.
My problem was that I didn't create a development folder at home. Creating and re-downloading the development folder resolved most issues.

Flutter running with no response after first installation in Windows

I'm new in flutter and trying to learn about it for the first time.
I'm following the instruction of flutter documentation in here
When in step to the setting environment, I follow the instruction here.
After restarting the pc, the next step I must running the command flutter doctor in cmd.
In this step, I get stuck because in cmd, flutter doesn't response anything.
I try to execute flutter inside VSCode It still stuck with loading.
I also try to running with android studio, Still the same, I get stuck with loading
What should I do?
I missed the important thing.
Just don't put it in the privilege directory.

Target file "lib\main.dart" not found while running $flutter run

I changed nothing, just worked on my Flutter Aplication, after the day i wanted to flutter run --release my app, but it didn't worked and i got this error message: Target file "lib\main.dart" not found. The day before everything worked fine. After a couple of times i tried it on another app, where i didn't changed something for a couple of days. But some of my other apps are working fine. The normal running in Android Studio is working normally on every app. Does anybody knwo what's the problem here?
My Error
My Directory
You are probably running your command on a different directory. Check your directory using pwd command on terminal.
Edit: As you use windows, make sure you open command line in your project directory.
See this tutorial.
https://www.lifewire.com/open-command-prompt-in-a-folder-5185505

Weird behavior of flutter and dart commands in PowerShell and CMD

I'm relatively new to Flutter but I already have developed and finished some Apps in Flutter.
Recently I noticed a weird behavior of commands with the keywords "dart" or "flutter" in it.
Here is an example:
I was trying to migrate an existing project to the new dart null-safety and typed the command dart migrate into my Visual-Studio-Code Terminal.
I was expecting an output like Migrating C:\.... as a response but instead got these three lines:
The command "git" is either misspelled or could not be found.
Building flutter tool...
Running pub upgrade...
and then the expected output:
Migrating C:\<project path>...
and so on.
So basically the commands work as they would normally do but I get these three lines before the output everytime. And it's not only with this command. Also basic commands like dart help or flutter doctor will get these three lines.
I don't know what I am doing wrong. I uninstalled Flutter and also removed it from the PATH and then reinstalled it freshly but it's still the same. I also searched the web but didn't found anyone who has the same problem.
Any help and explanation would be great. Thank you for your time :)
I think I know where the problem is. I ran the commands directly when I opened PowerShell. But the directory was something like C:\Windows\ and then it won't work.
After I did cd C:\Users\User all commands will work as expected.
I was just thinking that it doesn't matter from where I run dartand fluttercommands obviously you have to be in your user directory that they will work properly.

"flutter doctor" stucked, none of the flutter command working

I am running flutter on my windows machine, it was working earlier and I have created demo project with it.
Today when I run VSCode it asked me to update flutter and I did, but when it is updated it is not able to run any command. It doesn't do anything, neither error nor success. It just get stucked with any flutter command.
Note : It was working earlier, so there is no chance of setting environment variables, still I have double checked it and it is there.
I did not find any solution for this so the last available approach for me was to reinstall flutter SDK and it worked.
Note: If you are windows user, you might get an error about PowerShell version, you must have PowerShell version greater than 5.1