Amazon.co.uk Widgets

Log in

X
Flutter Logo - Flutter and the related logo are trademarks of Google LLC. We are not endorsed by or affiliated with Google LLC.

Installing Flutter 2.2 on macOS Big Sur 11.3.1

Runnning a flutter 2.2 based 'Hello, world' app on macOS.

Flutter 2.0 can now create macOS Big Sur desktop apps, This is the hello world example app.

TL:DR— Getting this running took around a dozen commands, and a bit of default question answering in both Flutter and Android Studio, which you have to launch once it has been installed. It assumes you already have Xcode installed and its command line toole. It took about 15 minutes to set it up. I use a folder called 'Projects' in my home directory but you can choose whatever name makes sense for you.

Android Studio

  1. Download and install Android Studio.
  2. Start Android Studio, and go through the ‘Android Studio Setup Wizard’. This installs the latest Android SDK, Android SDK Command-line Tools, and Android SDK Build-Tools, which are required by Flutter when developing for Android. Make sure you have the SDK Command-line tools installed!
  3. Android Studio Configure > SDK Manager will tell you where your sdk is installed. You need this path later.

Flutter

  1. Download Flutter from flutter.dev
  2. Use terminal to enter the commands to configure and run your first app
cd ~/Projects
$ unzip ~/Downloads/flutter_macos_2.2.0-stable.zip
$ export PATH="$PATH:`pwd`/flutter/bin"
$ flutter config --no-analytics
$ flutter doctor

Resolve any issues Flutter Doctor reports.


$ flutter config --android-studio-dir /Applications/Android\ Studio.app
$ flutter config --android-sdk /replacethiswiththepathtoyour/Library/Android/sdk
$ flutter doctor --android-licenses
$ flutter config --enable-macos-desktop
$ flutter doctor
$ cd ~/Projects
$ flutter create hello_world
$ cd hello_world/
$ flutter run -d macos

TL:DR Thats it!

Step by Step instructions to install Flutter 2.2 on macOS Big Sur 11.3.1

  1. By far the easiest way to install Flutter is to install Android Studio first
  2. Complete first run setup, let it download all the things it needs, check for updates and finish.
  3. Make flutter part of your environment, by adding the path to your .bashrcexport PATH="$PATH:/pathtowhereflutteris/flutter/bin""You'll need to restart your terminals or old school source it for this to take effect.
  4. Nobody likes being tracked, least of all by Google. You can turn it off.flutter config --no-analytics
  5. Tell Flutter about Android Studio by typing flutter config --android-studio-dir /Applications/Android\ Studio.app
  6. You'll need to accept the Android licenses to use Android Studio. Type flutter doctor --android-licensesand agree each one. If this command doesnt work, check you have the Android Command-line tools correctly installed.
  7. Almost there. Flutter needs to be told to enable macos support so type flutter config --enable-macos-desktop
  8. Check your confir using flutter doctorand of course fix any resulting issues.
  9. Navigate to your project folder or any folder you want to create your first app in. cd ~/Projects
  10. Use the create command to instantiate an app based on one of the example templates, type flutter create hello_world
  11. Change into its directory, cd hello_world/
  12. Run your first macos app created in Flutter flutter run -d macos

Android Studio

Make sure to select the Android SDK platforms of interest. Note also that you can see (and copy to the clipboard) the Android SDK location.

Android Studio, SDK PLatforms screenshot.

Make sure you select Android SDK Command-line Tools - it isn't selected by default and Flutter needs it.

Android Studio, SDK Tools screenshot

Flutter Doctor output

% flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.2.0, on macOS 11.3.1 20E241 darwin-x64, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0-rc4)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.2)
[✓] Connected device (2 available)

• No issues found!

Flutter Devices output

I am used to seeing mobile devices here. It really is running macOS Big Sur as a development target (and Chrome!).

% flutter devices
2 connected devices:

macOS (desktop) • macos  • darwin-x64     • macOS 11.3.1 20E241 darwin-x64
Chrome (web)    • chrome • web-javascript • Google Chrome 90.0.4430.212

See also

SDKManager #56778 on Github

Licences, trademarks, source code licences and attributions

Licences, trademarks, source code licences and attributions

928uk® is a trademark of Multizone Limited, registered in the UK. Multizone and this site is not affiliated with or endorsed by The Joomla! Project™. Any products and services provided through this site are not supported or warrantied by The Joomla! Project or Open Source Matters, Inc. Use of the Joomla!® name, symbol, logo and related trademarks is permitted under a limited licence granted by Open Source Matters, Inc. AdMob™, AdSense™, AdWords™, Android™, Chrome OS™, Chromebook™, Chrome™, DART™, Flutter™, Firebase™, Firestore™, Fuchsia™, Gmail™, Google Maps™, Google Pixel™, Google Play™, Pixelbook Go™, and Pixel™ and other trademarks listed at the Google Brand Resource center are trademarks of Google LLC and this site is not endorsed by or affiliated with Google in any way. Apple and the Apple logo are trademarks of Apple Inc., registered in the U.S. and other countries. App Store is a service mark of Apple Inc. The OSI logo trademark is the trademark of Open Source Initiative. UNIX® and the X® logo are registered trademarks of The Open Group. Any other product or company names may be trademarks™ or registered® trademarks of their respective holders. Use of these trademarks in articles here does not apply affiliation or endorsement by any of them.

Where the source code is published here on ezone.co.uk or on our GitHub by Angus Fox, Multizone Limited it is licenced according to the open source practice for the project concerned.

BSD 3-Clause "New" or "Revised" Licence
Original source code for mobile apps are licenced using the same licence as the one used by "The Flutter Authors". This Licence, the BSD 3-Clause "New" or "Revised" Licence (bsd-3-clause) is a permissive licence with a clause that prohibits others from using the name of the project or its contributors to promote derived products without written consent.
GNU General Public Licence v2.0 or later
Original source code for Joomla! published here on ezone.co.uk by Angus Fox, Multizone Limited is licenced using the same licence as the one used by Joomla!. This Licence, the GNU General Public Licence Version 2 or later (gpl-2.0) is the most widely used free software licence and has a strong copyleft requirement. When distributing derived works, the source code of the work must be made available under the same licence.

You can use any code you find here, just respect the licences and dont use the name of this site or our company to promote derived products without written consent. I mean, why would you? You're not us!

Amazon Associate
As an Amazon Associate we earn from qualifying purchases.
Logo
Our Logo Image is by Freepik. We chose it because its an M and also the letter A twice - and that represents us.