$ cat /etc/os-release NAME="Ubuntu" VERSION="20.04.1 LTS (Focal Fossa)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 20.04.1 LTS" VERSION_ID="20.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=focal UBUNTU_CODENAME=focal
Create a "dev" directory in your home directory and move it with `` `cd```.
$ mkdir dev $ cd dev
Clone flutter to the "dev" directory.
$ git clone https://github.com/flutter/flutter.git
Check the current path.
$ pwd /home/haru/dev
The official documentation explains how to pass the path like this.
pwdThe path returned by the command
「pwd」Copy and paste in the part.
Example: export PATH = "$ PATH: / home / haru / dev / flutter / bin"
Add this to bashrc. This time the editor uses VScode.
$ code ~/.bashrc (With VScode.Open bashrc and read "export PATH"="$PATH:/home/haru/dev/flutter/bin"』Paste) $ source ~/.bashrc
flutter doctorConfirm with.
$ flutter doctor
When the screen above appears, it is complete until you pass the pass.
Install Android Studio with "Ubuntu Software"
Install and run.
Go to Configure → Plugins at the bottom of the screen. Install the Flutter plugin.
After installing the plugin, you can start a new project from "Start new Flutter project".
Quit Android Studio once and accept the Android license with the following command. You will be asked for consent several times, so answer with "y".
$ flutter doctor --android-licenses Warning: File /home/haru/.android/repositories.cfg could not be loaded. 6 of 6 SDK package licenses not accepted. 100% Computing updates... Review licenses that have not been accepted (y/N)? y
After starting Android Studio, go to Configure → AVD Manager at the bottom of the screen. CreateVirtualDevice
In this environment, if you select the one with Play Store, it freezes when the emulator starts, so I used Pixel 2 XL without Play Store. System Image uses Q (API29).
Changed the Graphics item to "Software-GLES2.0".
Finally, check with ``` flutter doctor` ``.
$ flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 1.20.3, on Linux, locale ja_JP.UTF-8) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2) [✓] Android Studio (version 4.0) [✓] Connected device (1 available) • No issues found!