Installing Flutter using Homebrew - flutter

I would like to install Flutter on my Apple M1 machine using Homebrew. But I am a bit hesitant because I am not sure if this will provide any benefits or it will create more trouble (e.g. permission issues). An alternative way would to be install Flutter using its installer from its docs.
My question is, is there a recommended way to install Flutter on an Apple M1 macbook? I could not find any docs regarding installing Flutter using Homebrew.

I ended up installing Flutter in with the following steps:
Install Homebrew (if you dont already have)* - install Homebrew
Install fvm using Homebrew - install fvm
Install your wanted flutter version through fvm - fvm documentation
Not necessary: Install Sidekick which basically gives you a visualization of your installed versions and flutter projects - install sidekick
Example of using fvm: fvm install {version} - # Installs specific version

#ilpianoforte Does a great job outlining the steps, but I needed to do an additional step for macOS 13.x. So, I thought I would consolidate here.
To install Flutter via Homebrew.
Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install fvm with Homebrew (this manages multiple versions of Flutter)
brew tap leoafarias/fvm
brew install fvm
Install the latest stable version of Flutter
fvm install stable
Append the path to Flutter to PATH by copying the line below into .zshrc (located in the home directory). IMPORTANT: Make sure to replace [USER_HERE] with your user name.
export PATH=$PATH:"/Users/[USER_HERE]/fvm/default/bin"
Reload .zshrc
source ~/.zshrc
Optional: Test Flutter installation.
flutter doctor

Related

cocoapods intallation Errors in mac for flutter doctor

I install Homebrew.
Then I run command
"brew install cocoapods". It install successfully
but in flutter doctor i got error: cocoapods installed but not working properly. Error because of ruby incompatible version.
Tried another method
"sudo gem install cocoapods"
and got error:
While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0 directory.
This is m1 pro 2020 machine.
For MAC M1 chip Users try this solution
install ffi first (if not) In regular terminal using command: sudo arch -x86_64 gem install ffi then arch -x86_64 pod install --repo-update
Run flutter clean
Once complete, rebuild your Flutter application: flutter run
Try to avoid linking with system ruby and download a new ruby version using brew:
brew install ruby
Then add this line to .bash_profile or .zshrc
export PATH=/usr/local/opt/ruby/bin:$PATH
Close the terminal and open it again, then run this line to make sure the default ruby is the newly installed:
which ruby
Uninstall gem cocoapods and download it using brew
brew install cocoapods

How to uninstall fvm (Flutter Version Manager)?

I want to uninstall FVM and install native Flutter
I already looked in the FVM documentation but I didn't find anything, and I need to uninstall FVM and install native Flutter
Run command fvm list this will output the directory used for Flutter cache. Delete that directory. If you installed using pub run dart pub global deactivate fvm, if you used a standalone installation please follow its instructions.

MacOS newbie - Can't run flutter command from CMD?

I want to run flutter SDK from CDN, but it's not possible.
I followed the instructions on how to update the path to the flutter bin dir, but that is not working.
I have restarted my laptop but still doesn't work. Help! :)
My preferred way to install terminal applications is to use homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
you can then install flutter using homebrew as follows:
brew install --cask flutter

Can't upgrade dart sdk

I'm using VS Code to practice the Dart language (not flutter, I'm using Android Studio for that). My file's name is main.dart. Anyways, VS Code keeps telling me to upgrade Dart to the latest version.
Whenever I do, the command prompt/Powershell informs me that access to path 'dart.exe' is denied, specifically C:\tools\dart-sdk\bin\dart.exe.
How do I fix this?
You can upgrade dart SDK using flutter console:
1- Head to your flutter SDK folder path ( where you downloaded flutter SDK).
2- Open flutter console and type flutter upgrade --force.
This will upgrade both flutter and dart SDKs
you can upgrade dart sdk by using flowing command:
In Windows
choco upgrade dart-sdk
In Linux
If you’re using Debian/Ubuntu on AMD64 (64-bit Intel), you can choose one of the following options, both of which can update the SDK automatically when new versions are released.
Install using apt-get
Install a Debian package
Install using apt-get
Perform the following one-time setup:
sudo apt-get update
sudo apt-get install apt-transport-https
sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
Then install the Dart SDK:
sudo apt-get update
sudo apt-get install dart
Install a Debian package
Alternatively, download Dart SDK as Debian package in the .deb package format.
Modify PATH for access to all Dart binaries
After installing the SDK, add its bin directory to your PATH. For example, use the following command to change PATH in your active terminal session:
export PATH="$PATH:/usr/lib/dart/bin"
To change the PATH for future terminal sessions, use a command like this:
echo 'export PATH="$PATH:/usr/lib/dart/bin"' >> ~/.profile
For more details visit this link:
https://dart.dev/get-dart

ionic 2 installation requirements

Am just getting started with ionic 2 and am having problems with the installation . I want to know the requirements for installing ionic 2 apart from node and npm.
Do i need to have android sdk installed? What other stuff should I have.
You would need java sdk 1.7 or higher.
You do need to download the Android Studio and install the required android sdk version for which you would want to build.
You would also need the node version of minimum of v6.9.0 or higher.
try running node --version
And do read up on ionic appscripts in github. There are changes perhaps you would need to apply - https://github.com/driftyco/ionic-app-scripts
You could also Try installing nvm -
https://github.com/creationix/nvm
its called the node version manager. will allow you to have multiple versions of node installed and certainly recommended.
Preferably try and build on the linux platform, to avoid silly issues in windows.
Things you need for installing ionic with windows
nodejs
android sdk
java sdk.
setting path is most important
apache ant
You could check out this link for installing and running to android device
http://www.tiagoporto.com/blog/environment-setting-tutorial-ionic-android-on-windows/
to setup ionic you need to do the following
run
sudo apt-get install nodejs
sudo npm install -g cordova
then
sudo npm install -g ionic
Done run ionic serve inside app folder created using
ionic start todo super --type v2 !!
this will help you to run app on browser
now to install on device,
you need android SDK,
and then you will be able to install apk on phone.
to do that you need to setup android SDK
use the following lines to do that
Install openjdk
sudo apt-get install openjdk-7-jdk lib32stdc++6 lib32z1
Download android sdk
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
tar -xvf android-sdk_r24.2-linux.tgz
install all sdk packages
cd android-sdk-linux/tools
./android update sdk --no-ui
Set android-sdk path
pico ~/.bashrc
Add these lines on top, save, and exit
export PATH=${PATH}:~/android-sdk-linux/tools
export PATH=${PATH}:~/android-sdk-linux/platform-tools
Reload bashrc
source ~/.bashrc