Error while installing flutter - dart

$ flutter doctor
Downloading Dart SDK 2.0.0-dev.16.0...
Unknown operating system. Cannot install Dart SDK.
error got shown up,why it occurs.

$ flutter doctor
Run this command in either a Command Prompt or PowerShell window. Currently, Flutter does not support third-party shells like Git Bash.

go to
windows power shell->
right click->run as administrator->type flutter doctor

I was having this issue, the only way I fixed it was removing my download of the flutter SDK, redownloading it and pointing my path variable to my new installation.

It is because of Path issue of other command props(like git bash etc.). So if you will use Windows Comand promp it would work.

If you use MINGW or cygwin in window, you can face this problem.
Let try flutter on cmd.

The error is thrown in Git Bash where currently it is not support. Try using Windows Powershell or command prompt.

It's an error from git bash cmd, so:
run cmd prompt as administrator
run flutter doctor
Problem solved, Dart would start downloading.

Related

How can I fix "Checking Dart SDK version... << was unexpected at this time" error in Flutter?

I am facing an issue any time I try to run any app or flutter command from the terminal, this is displayed: Checking Dart SDK version... << was unexpected at this time.
Not even flutter doctor works.
Nothing seems to work and it's so frustrating as it happened out of the blue. One moment everything was fine, now nothing works. Any help will be appreciated
I've resolved this error with the below steps:
Go to C:\Users\{Name}\.gradle} - Delete the .gradle directory.
Then Download and install the same flutter and dart SDK version in some other location and set the environment variables.
Example:
Environment variables Before :
("D:\FlutterExtractedFiles\flutter\bin")
("D:\FlutterExtractedFiles\flutter\bin\cache\dart-sdk\bin")`
Environment variables After :
("C:\edgedownloads\flutter_windows_v1.12.13+hotfix.8-stable\flutter\bin")
("C:\edgedownloads\flutter_windows_v1.12.13+hotfix.8-stable\flutter\bin\cache\dart-sdk\bin")
Then check the Android Studio event log
I've resolved this error by following these steps:
Go to folder C:....\Flutter\
Run this command: git reset --hard HEAD
This will restore the flutter SDK folder to its original state, so no need to reinstall the SDK.
Flutter reinstalled worked for me..
delete flutter folder in C directroy.
make a src folder in C: directory.
GoTo cmd and install flutter from official flutter github repoC:\src>git clone https://github.com/flutter/flutter.git -b stable
https://flutter.dev/docs/get-started/install/windows
run flutter doctor
set env path.
DONE
What worked in my case was deleting the .gradle file (C:\Users\USER.gradle) and reinstalling Flutter in another location and changing the PATH to it.
you should try this
restart your pc and delete the flutter folder in C directory then reinstall flutter and run flutter doctor
For me, the following steps resolved the problem:
Open cmd and run flutter doctor. (if there is an issue resolve them first.)
If not then change the flutter channel to dev. Whatever your channel is?. If this is the dev channel then change to master channel.
Again flutter doctor. If everything goes perfectly. then run your project. If it runs accordingly then again change to channel to stable.
I faced this error before, all I had to do was to:
Remove Flutter from my C directory.
Install Flutter from the official website.
Run Flutter doctor: flutter doctor
No need for changing the PATH or any further actions.
If it worked fine with you then you are all done!
I faced another error after it, related to the Dart SDK and solved it using this link
the key is to install Android SDK Command-line Tools, steps being:
Open Android Studio Tools Menu, SDK Manager In the window that comes
up there are inner panels, choose SDK Tools panel Tick Android SDK
Command-line Tools Choose Apply button near the bottom of the window
At that point, you will be prompted to accept the SDK license and the
command line tools will be installed. Your license issue should now be
resolved.
If your using Intelij and get the << error and none of the above work.
Delete the .intelij folder in your project and reopen the folder in intelij.
I faced this problem too and I've solved it by downloading SDK file again.

Flutter Installation Issue

I have macOS sierra 64 bit, and I am trying to install flutter SDK kit.
When updating my path to export PATH=$PATH/Users/mayankvaswani2008/Developer/flutter/bin and using the command
echo $PATH
I get this path
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin/Users/mayankvaswani2008/Developer/flutter/bin
then when I type flutter doctor or flutter by itself, it says that
-bash: flutter: command not found
Please help
As pskink said,
You need to add in a colon between paths in MacOS. You'll want to go in and remove the flutter path, then run this: PATH=$PATH:/Users/mayankvaswani2008/Developer/flutter/bin
Should do the trick.

Flutter run command error : FlutterView.send called on a detached view

Can anyone tell me why my app is not installing at all and ending with the error message
Observatory connection never became ready.
the app was working perfectly fine until yesterday .
I have changed the channel to master yesterday in the command prompt and from then on the app never runs.
I even switched back to channel alpha but still no use.
I have attached a screenshot of the command prompt where the installation was stuck forever.
I am not so sure if I need to reinstall the flutter. I am worried if I uninstall the flutter now it may not configure properly and I might break it forever.
Please can someone tell me what exactly might have gone wrong.
Many Thanks,
Mahi
Instead of reinstall try with following: (Mac)
Set Path Variable: via following terminal command
export PATH=~/flutter/bin:$PATH;
that is bin folder path of flutter.
export PATH=[PATH_TO_FLUTTER_GIT_FOLDER]/bin:$PATH
https://flutter.io/setup-macos/#update-your-path
If above not worked. Check with the Dart version
dart --version
Install the latest dart version:
brew install dart --devel
Hope this helps others.
For Mac
open terminal
$ echo $PATH
it will show like this
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:
it means you need to add flutter in to path
Open Finder presss command + shift + G
Put /etc/paths in dialog and press GO
Copy the file "paths" and paste it on desktop
Then open the pasted "paths" file from desktop
and add following line into end of the file "/flutter/bin"
Then copy that file and again paste it on /etc/paths
same like step no 2
it will ask you to replace or not
press replace
Now if you hit $ echo $PATH on terminal it will show
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/swagat/development/flutter/bin
Now your $flutter doctor will work perfectly
The solution is from Google Groups #Flutter-Dev
Thank you very much for your reply #Michael Thomsen.
I've tried what you have suggested and the details are as follows:
When I used flutter run -v command the command prompt output is as follows:
It was stuck for a while at waiting for port connection if I am not wrong.
So I've used AndroidStudio, File>Open and selected android/ folder to run the app then the gradle was showing an error:
Error:Conflict with dependency 'com.android.support:support-annotations' in project ':app'. Resolved versions for app (25.2.0) and test app (25.4.0) differ. See http://g.co/androidstudio/app-test-app-conflict for details.
I modified the build.gradle(Module:app) to show the correct version of 25.2.0 which was previously showing 25.4.0.
dependencies {
androidTestCompile 'com.android.support:support-annotations:25.2.0'
}
I just saved the changes inside android studio and the gradle sync completed without any errors.
Now I can run the app from inside Android Studio and also from IntelliJ IDE.
Thanks very much Michael this solved my problem.
Reinstalling flutter would be my starting point. If this problem persists, please post the output of $>flutter doctor and a description of what exactly leads to this error.

stagehand command not found when trying to create new application

I just installed stagehand on my mac and the install went off without a hitch, but when I try using it to spawn a new dart application I get this error -bash: stagehand: command not found. Any ideas?
I've looked at my machine, and stagehand is in ~/.pub-cache/bin which I think I had to add to my .profile manually:
export PATH=$PATH:~/.pub-cache/bin
(edit: I've just found the confirming information tucked away in the pub pages: https://www.dartlang.org/tools/pub/cmd/pub-global#running-a-script-from-your-path)
I'm on mac too. I did this:
brew tap dart-lang/dart
brew install dart
stagehand
zsh: command not found: stagehand
And then this command fixed it:
pub global activate stagehand
Now it works:
stagehand
Welcome to Stagehand!
I came across same issue on my windows pc. I had to check flutter installation directory and add following .pub-cache\bin directory to Windows path environment variable.
D:\flutter\.pub-cache\bin
I think this might be helpful to any Windows user.
On MacOS run this command: export PATH="$PATH":"$HOME/.pub-cache/bin"
I installed it, but still gave me error not found, but I noticed warning in following message after running the command:
Package stagehand is currently active at version 3.3.11.
Resolving dependencies...
The package stagehand is already activated at newest available version.
To recompile executables, first run `global decativate stagehand`.
Installed executable stagehand.
Warning: Pub installs executables into C:\Users\Nijat\AppData\Local\Pub\Cache\bin, which is not on your path.
You can fix that by adding that directory to your system's "Path" environment variable.
A web search for "configure windows path" will show you how.
Activated stagehand 3.3.11.
The problem is this line:
Warning: Pub installs executables into C:\Users\Nijat\AppData\Local\Pub\Cache\bin, which is not on your path.
Thus, you also need to add that to your environment variables. This solved my problem and now I can run stagehand.

Appium doctor shows error

When I run Appium doctor it shows:
Running iOS Checks
✖ Unknown SW Version Command: Error: Command failed: /bin/sh -c sw_vers -productVersion
/bin/sh: sw_vers: command not found
Appium-Doctor detected problems. Please fix and rerun Appium-Doctor.
Can anyone help let me know what is the wrong here?
running this solved my problem:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
You need to install the command line tools as marked in your message:
✖ Xcode Command Line Tools are NOT installed
From osxDaily:
Launch the Terminal, found in /Applications/Utilities/
Type the following command string:
xcode-select --install
A software update popup window will appear that asks: “The xcode-select command requires the command line developer tools. Would you like to install the tools now?” choose to confirm this by clicking “Install”, then agree to the Terms of Service when requested (feel free to read them thoroughly, we’ll be here)
Wait for the Command Line Tools package download to complete, it’ll be about 130MB and installs fairly quickly depending on your connection speed
The installer goes away on its own when complete, and you can then confirm everything is working by trying to use one of the commands that were just installed, like gcc, git, svn, rebase, make, ld, otool, nm, whatever you want from the list below. Assuming the installation went uninterrupted, the command will execute as expected. This also means you can compile and install things from source code directly without having to use a package manager. Enjoy your new unix command line toolkit!
Have you tried upgrading to the latest Appium version? Are you installing Appium through terminal? My appium-doctor issues were fixed after I installed Appium through terminal and updated the path variables in .bash profile. Appium desktop application is different than one installed through command line.
There are only two possible area which causing that error:
You need to keep all path veriable updated and correct in .bash_profile
You must install
XCode
NodeJS
properly. You must have all permission to access those.
Install all latest version of following things
JDK (Java Development Kit),
Xcode ,
Command Line tools ,
APPIUM For MAC OS
In my case, xcode command line tool isn't set. Simply go to Xcode>Preferences>Locations>Select desired Xcode version in Command Line Tools. OR from terminal follow Chhagan's answer xcode-select -s your path

Resources