×
×

Spread the love

In this tutorial you will learn how to install flutter on Ubuntu.For this you need to get Flutter SDK, android sdk and android studio for working with flutter.So lets dive in.

Windows : How to install flutter on windows with android studio.
Mac : How to install flutter on mac with Xcode.
Visual studio code : How to install flutter with visual studio code.

Note: The content of this post is completely referenced from flutter official website.

How to install Flutter on Ubuntu?

System requirements

To install Flutter on ubuntu, your development environment must meet these minimum requirements

  • Operating Systems: Linux (64-bit)
  • Disk Space: 600 MB (does not include disk space for IDE/tools).
  • Tools: Flutter depends on these command-line tools being available in your environment.
    1. bash
    2. curl
    3. git
    4. mkdir
    5. rm
    6. unzip
    7.which

Get the Flutter SDK

  • Download the latest flutter SDK from the flutter official site from the link below.
    Download Flutter SDK

Extract the file in the desired location.For example

$ cd ~/development
$ tar xf ~/Downloads/flutter_linux_v1.12.13+hotfix.5-stable.tar.xz

Now you have to add the flutter tool to your path.Open a terminal and go to the home directory and then to current user directory by typing the following command.

$ cd /home/{current_user}

and then type this command.

$ gedit .bashrc

The above command will open a file. At the end of this file add the path of the Flutter SDK by using the following command.

$ export PATH={path-of-sdk}/flutter/bin:$PATH

The path for the sdk will look like /home/{current-user} if your sdk is in home directory, so the final command will be like

$ export PATH=/home/{current-user}/flutter/bin:$PATH

Save and close the file and also close the terminal and open a new one for the changes to take effect.
Now run the following command in the new terminal to see the updated path.

$ echo$PATH

Verify that the flutter command is available by running

$ which flutter

Run flutter doctor

Run the following command to see if there are any dependencies you need to install to complete the setup (for verbose output, add the -v flag)

$ flutter doctor

This command checks your environment and displays a report to the terminal window. The Dart SDK is bundled with Flutter; it is not necessary to install Dart separately. Check the output carefully for other software you might need to install or further tasks to perform (shown in bold text).

[-] Android toolchain - develop for Android devices
    • Android SDK at /Users/obiwan/Library/Android/sdk
    ✗ Android SDK is missing command line tools; download from https://goo.gl/XxQghQ
    • Try re-installing or updating your Android SDK,
      visit https://flutter.dev/setup/#android-setup for detailed instructions.

Once you have installed any missing dependencies, run the flutter doctor command again to verify that you’ve set everything up correctly.

Android Studio Setup For Flutter in Ubuntu

Install Android Studio

Skip this step if you already have android studio installed.

  • Download and install Android Studio.
  • Start Android Studio, and go through the ‘Android Studio Setup Wizard’. This installs the latest Android SDK, Android SDK Platform-Tools, and Android SDK Build-Tools, which are required by Flutter when developing for Android.

Set up your Android device

To prepare to run and test your Flutter app on an Android device, you’ll need an Android device running Android 4.1 (API level 16) or higher.

  • Enable Developer options and USB debugging on your device. Detailed instructions are available in the Android documentation.
  • Windows-only: Install the Google USB Driver.
  • Using a USB cable, plug your phone into your computer. If prompted on your device, authorize your computer to access your device.
  • In the terminal, run the flutter devices command to verify that Flutter recognizes your connected Android device.

By default, Flutter uses the version of the Android SDK where your adb tool is based. If you want Flutter to use a different installation of the Android SDK, you must set the ANDROID_HOME environment variable to that installation directory.

Set up the Android emulator

To prepare to run and test your Flutter app on the Android emulator, follow these steps

  • Enable VM acceleration on your machine.
  • Launch Android Studio > Tools > Android > AVD Manager and select Create Virtual Device. (The Android submenu is only present when inside an Android project.)
  • Choose a device definition and select Next.
  • Select one or more system images for the Android versions you want to emulate, and select Next. An x86 or x86_64 image is recommended.
  • Under Emulated Performance, select Hardware – GLES 2.0 to enable hardware acceleration.
  • Verify the AVD configuration is correct, and select Finish.
    For details on the above steps, see Managing AVDs.
  • In Android Virtual Device Manager, click Run in the toolbar. The emulator starts up and displays the default canvas for your selected OS version and device.

Install Flutter and Dart plugins

  • Start Android Studio.
  • Open plugin preferences ( Preferences > Plugins on macOS, File > Settings > Plugins on Windows ).
  • Select Marketplace, select the Flutter plugin and click Install.
  • Click Yes when prompted to install the Dart plugin.
  • Click Restart when prompted.

That’s all about how to install flutter on ubuntu and how to configure android studio to work with flutter.We will discuss other flutter concepts in next posts.

Do like and share if you find this post helpful.Thank you!!


Spread the love

AUTHOR

Naresh Pradeep

Hey there! I am the founder of CodesInsider and android developer.I love to code and build apps.


Related Posts

2 responses to “How to Install Flutter on Ubuntu with android studio”

  1. Hafez ahasan says:

    My app Development sikunga..?

    • Naresh Pradeep says:

      I don’t understand. Are you saying you will teach app development? or do you want to learn app development?

Leave a Reply

Your email address will not be published.