750 grammes Tous les blogs Top blogs Cuisine Tous les blogs Cuisine
Tous nos blogs cuisine Editer l'article Suivre ce blog Administration + Créer mon blog
MENU
http://lbkjw.over-blog.com/

lbkjw.over-blog.com/

Publicité

Flutter Install Mac



Flutter has good installation documentation, but to install it on macOS Catalina you need to fly above some further obstacles. I'm writing some instructions here for reference and to help out any other potential lost programming souls.

  1. Flutter Macos
  2. Flutter Mac Setup
  3. Install Flutter Sdk
  4. Flutter Install Mac Os

Setting up a Flutter development environment on Mac OSX. Here is the the steps I'm usually taking when reinstalling my Mac OS from scratch (or when buying a new Mac) to have a completed environment to Flutter development. Install and run Xcode. How to copy picture in mac. Windows live movie maker for mac free. If you want to write and test your Flutter code for iOS you'l definitely need Xcode. MacOS supports developing Flutter apps in iOS, Android, and the web (technical preview release). Complete at least one of the platform setup steps now, to be able to build and run your first Flutter app. IOS setup Install Xcode. To develop Flutter apps for iOS, you need a Mac with Xcode installed. Select Flutter extension in the list and click install. This step will install Flutter extension and also Dart extension. Flutter uses Dart language therefore Dart extension gets installed automatically with Flutter extension. Run Flutter Doctor. Flutter needs several dependencies to be installed.

Install the Flutter SDK

  • Download the latest stable release from here.
  • Unzip and move the flutter folder under /Users//developement (create one if you don't have one and don't change this in the future or you'll have to update the path again).
  • Update your path:
  • If running the flutter command fails and you get an xcrun error, try typing xcode-select --install to update the Command Line Tools and then restart the Terminal again.
  • Now you might get an error saying: 'dart' can't be opened because Apple cannot check it for malicious software. The only option I found to remedy this is to globally disable Gatekeeper by typing sudo spctl --master-disable
  • Now the flutter command should be working, so we can type flutter doctor to check for missing dependencies.

Install Xcode

To develop apps for iOS, we need to install Xcode.

  • Install the latest version from the App Store on your Mac.
  • Configure the command-line tools by running sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer and sudo xcodebuild-runFirstLaunch
  • Run sudo xcodebuild -license to accept the license agreement.
  • Later on, you might get an error saying: 'idevice_id' cannot be opened because the developer cannot be verified. Or the equivalent message for 'ideviceinfo', 'idevicesyslog' or 'iproxy'. You can type the lines below into your Terminal to silence the warnings, replacing like before.

Flutter Macos

If there is another message that is not in this list, you can search for its path in flutter/bin/cache/artifacts and type the equivalent message to the above in your Terminal.

Test the iOS Simulator

  • Open by typing in Terminal open -a Simulator
  • To create a sample app from the Terminal:
Flutter Install Mac

You should see an app running on your Simulator now where you can tap a button to increase the counter.

Install Android Studio

  • Download the latest version from here.
  • Run the installation wizard with all the default settings.
  • When trying to install Intel HAXM, Apple will show a warning. We need to go to System Preferences -> Security & Privacy, click on the lock symbol and enter your password to make changes. There should be a message under ‘Allow apps downloaded from', click on Allow and wait a bit for the installation to finish. This is necessary to enable VM acceleration. We can check whether HAXM is successfully installed by typing in the Terminal: kextstat | grep intel and we should get a message containing com.intel.kext.intelhaxm if successful.
  • Finally, don't forget to copy Android Studio into your Applications folder.

Test the Android Emulator

Mac fix fluid review. Create a Virtual Device Pikka 2 0 16.

  • Open Android Studio and tap on the Configure button at the bottom.
  • Go to AVD Manager -> Create Virtual Device.
  • Choose a device (ex. Pixel 2).
  • Download one of the recommended system images (ex. Android 10.0 (Q)) and tap Next.
  • Under Emulated Performance, select Hardware — GLES 2.0 (or leave it on Automatic if it can't be selected). It seems to work fine with hardware acceleration on my Mac as I'm getting the message ‘Using hardware rendering with device Android SDK built for x86.' when I'm typing flutter run.
  • Tap on Finish and then on the play button to launch the AVD in the Emulator.
Installing legacy Java on macOS Catalina

And for the final big hurdle, we need to install a legacy version of Java, in quite a hacky way.

  • If you try to run the sample app by typing flutter run, you might get a popup that you need to install Java for Mac. It also points you to the Java website where you happily download the latest version of Java (don't do it!) and install it (don't do it!). But this doesn't make the popup go away, because you need a legacy version of Java for Mac. This version is 2017–001 and you can get it from Apple.
  • If you, like me, naively installed the latest version of Java, you can uninstall it by following these instructions.
  • Now it gets even trickier. Even if you uninstalled all existing versions of Java, you might still get an error message when you're trying to install the legacy version saying: 'Java for macOS 2017–001 can't be installed on this disk. A newer version of this package is already installed.'. To get around this, you can implement this nice hack that I found here, or follow the instructions below.

Test the Emulator

  • Go to the directory where we saved my_app before and type flutter run
  • The sample app should run on the Android emulator now, where you can again tap on a button to increase the counter!
  • Finally, type flutter doctor --android-licenses to accept the Android licenses.

Dr. Flutter

Flutter Mac Setup

We should now have the sample app running on both iOS Simulator and Android Emulator! Mac crop png.

Type once again flutter doctor to see if there are any issues left. There shouldn't be any, except for the missing devices warning if you don't have the Simulator or Emulator open.

You can type flutter devices to see all currently connected devices. If the Simulator or Emulator are not open, they won't show up here.

You can also type flutter emulators to see all available simulators/emulators. We should see 2 now, the Pixel 2 and the iOS Simulator.

Install Flutter Sdk

Support for web

We can also add support for the web by following these instructions, although it's still in early support and only on the master branch (not recommended for production).

Install the Flutter and Dart plugins for Android Studio

Finally, in order to develop with Flutter we need to install the Flutter and Dart plugins for Android Studio.

Flutter Install Mac
  • Open Android Studio and go to Configure -> Plugins.
  • Search for the Flutter plugin and install it. This will also install the Dart plugin as it is a dependency.
  • Restart the IDE when installation is done.
  • We can now do the Test Drive by building our first Flutter app!

Flutter Install Mac Os

Upgrade Flutter

To upgrade Flutter, simply run flutter upgrade.

You can also learn more about Flutter's release channels here.

Thanks!





Publicité
Partager cet article
Repost0
Pour être informé des derniers articles, inscrivez vous :
Commenter cet article