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.
Related
I'm using Xcode 13.3.1.
I'm trying to build a flutter application in Android Studio. It failed with the following error. To make it dead simple I tried just running xcodebuild which produced the same error as in Android Studio:
.oh-my-zsh git:(master) xcodebuild
2022-04-21 19:45:25.858 xcodebuild[32450:312401] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2022-04-21 19:45:25.859 xcodebuild[32450:312401] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild
User defaults from command line:
IDEPackageSupportUseBuiltinSCM = YES
xcodebuild: error: The directory /Users/salahuddin/.oh-my-zsh does not contain an Xcode project.
Any idea what causes this error and how to fix it?
Please refer to the message, you can find out solution.
https://developer.apple.com/forums/thread/703233
SOLUTION (for me):
I had to first find the software update manually:
softwareupdate --list
This provided me with the following output:
Finding available software
Software Update found the following new or updated software:
Label: Command Line Tools for Xcode-13.3
Title: Command Line Tools for Xcode, Version: 13.3, Size: 718145KiB, Recommended: YES,
I then ran:
softwareupdate -i "Command Line Tools for Xcode-13.3"
(NOTE: You pass the "Label:" output as the string as yours could be different.
This command worked out for me: softwareupdate -d -a.
Reference: https://huckfinnsmoneytree.com/how-to-download-macos-updates-using-the-terminal/
I faced the same problem when updating the project with Flutter 3. After several attempts, the below solution worked for me.
I have deleted the podfile.lock file inside the ios folder and then run the below commands.
flutter pub upgrade
flutter pub get
cd ios
pod repo update > Actually, this was an error for me but ignored it
pod install
Also please make sure you are using the latest MacOS and Xcode.
I hope this will help someone else.
Looks like you need to install the Xcode command line tools, which you can do by executing the following command in Terminal:
xcode-select --install
This worked for me:
Completely turn off Bluetooth.
in ios/ folder of your project, change Podfile to
platform :ios, '12.0'
Run pod deintegrate in Terminal inside the ios/ folder of your project.
Run pod install --repo-update in your ios/ folder
https://solveforums.msomimaktaba.com/threads/solved-flutter-for-ios-run-build-but-not-archive.699314/
The error mentions that there's no iOS project to be found on the directory.
xcodebuild: error: The directory /Users/salahuddin/.oh-my-zsh does not contain an Xcode project.
You'd need to navigate to the iOS build of your Flutter project on your terminal with cd ios and run xcodebuild there.
multiple xcode.app you need to remove.(Download folder)
XCode-> Preferences-> Locations -> Command Line Tools
Check it shows multiple entries for same xcode version.
Delete xCode.app other than Application folder.
quit and restart xcode and terminal.
My issue was that I was using Xcode 13.4. I downloaded Xcode 13.3 from here and everything started working again.
I was encountering this issue on a self-hosted GitHub runner so in order for the fix above to work, I needed to:
Uninstall the Xcode 13.4
Remove the GitHub runner
Install Xcode 13.3
Re-add the GitHub runner
Try This.
Remove any command line tools:
sudo rm -rf /Library/Developer/CommandLineTools
Reinstall them:
xcode-select --install
Tell the system to use them:
sudo xcode-select -s /Library/Developer/CommandLineTools
If still not working, try that:
In Xcode > Preferences > Locations tab
Simply select the right toolset.
I'm trying to develop a command line package so I followed these steps:
dart create --template=package-simple package_name
then activating the package globally with:
dart pub global activate --source path $(pwd)
note that I didn't find anything in the documentation about --source path actual_path but whenever I use the command only with --source actual_path I get the following:
"/Users/user/Desktop/Workspace/package_name" is not an allowed value for option "source".
So after successfully activating the package I tried to run it using:
package_name
But I got this:
zsh: command not found: package_name
Found out that the documentation here is outdated and after searching the local directory I found the actual directory is global_packages not bin, and so I've changed it.
Now when I try package_name I get:
zsh: permission denied: package_name
After investigation I found that package_name is a directory in the global_packages directory and it only contains pubspec.lock so I've tried chmod a+x on the file and the directory with no avail.
Further investigation the global_packages contained another package intl_utils inside I found:
.packages incremental
.dart_tool bin pubspec.lock
But running intl_utils on the terminal too get's me the same error:
zsh: permission denied: intl_utils
I didn't install the package manually but the VS Code extension Flutter Intl did and it seems to work perfectly fine.
Now I have two questions:
permission denied on what exactly since the Flutter Intl extension works perfectly???
I have a file in my package bin/my_package.dart but it didn't go there, am I doing something wrong?
I'm running dart through flutter:
Flutter (Channel master, 2.13.0-0.0.pre.90, on macOS 12.3 21E230 darwin-x64, locale en-US)
dart --version
Dart SDK version: 2.17.0-202.0.dev (dev) (Thu Mar 10 20:55:41 2022 -0800) on "macos_x64"
Edit #1
Tried dart pub global run package_name and it worked but it seems like it's building the package again, but still I need to use it without the long line the correct way.
Edit #2
To create the app I've tried
dart create -t console-full package_name but still with the same results.
So after messing around and changing the branch (a lot) turns out the problem is in the pubspec.yaml where there should be :
executables:
package_name: # you can add a custom path here if you want though
And I guess the docs were right about "bin" directory but it left me wondering about global_packages and intl_utils
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 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.
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.