In this article, we cover how to install Flutter in Ubuntu 22.04 release. Flutter is used to build applications from a single codebase. Such applications can be run across multiple platforms. It is an open-source framework developed by Google.
Earlier, we had to write separate code to get our application working for different platforms. For instance, if we were writing a code to build an application that is intended to work with mobile platform like Android & iOS. Then, we had to write separate code for both Android and iOS. It was time consuming to build an identical applications for different platforms.
But, with the help of Flutter we can build applications that can run across platforms with a single codebase. We cover its installation steps next.
Note: Following operations require Administrative rights. Contact your System Administrator if you don’t have the required rights.
Install Flutter in Ubuntu 22.04
We can install Flutter Snap package. Before that, package – snapd is required to manage Snap packages. If, for some reason, it isn’t there then issue the following commands in terminal to install snapd –
sudo apt update sudo apt install snapd
Thereafter, to install Flutter –
sudo snap install flutter --classic
This would return with the following message in standard output once our package is successfully installed.
flutter 0+git.ccbc698 from Flutter Team✓ installed
It gets us three command-line utilities –
Run the following command to check whether there are issues with Flutter installation –
For us, it was about Android Studio. We installed it through the following command –
sudo snap install android-studio --classic
Next, Flutter needs to know our Android Studio installation directory –
flutter config --android-studio-dir /snap/android-studio/current/android-studio
Run the following command to launch Android Studio –
Finish the entire setup. We went ahead with default configuration and followed on-screen instructions. Run the following command again to find Flutter installation issues –
It may return with following two errors –
cmdline-tools component is missing and, Android license status unknown.
Create a New Project with Android Studio and from the Main menu, click Tools –> SDK Manager –> SDK Tools.
Check the option which says – Android SDK Command-line Tools (Latest)
And, confirm the changes.
For Android license status unknown, issue the following in terminal –
flutter doctor --android-licenses
Once you accept the licenses, run the following command again –
It should be fine now.
In conclusion, we have covered here how to install Flutter in Ubuntu 22.04 release.