Motivation
Currently, I am in an environment where I cannot use my personal PC and can only use public PC. Public PCs are virtually impossible to install and use multiple programs because the disk is formatted immediately upon reboot. In this situation, I looked up various ways to develop Flutter and succeeded in building an environment. I hope this article will help Flutter developers who are in a similar situation to me.
Sources
Basically, these are the posts I looked up.
- How to setup Android SDK without Android Studio.
- Install Flutter SDK on windows without Android Studio
- LinuxBrew(HomeBrew) Install (Ubuntu 18.04)
- code-server + gcp
- Install Chrome in Linux
- Ubuntu Install Android Studio
Linux Server
I opened the server through Google Cloud Platform.
code-server + gcp
Ubuntu's version was 22.04 LTS and the disk size was set to 64GB.
I'm only going to use free credit anyway, so it doesn't matter if I set it up randomly.
Install Openjdk
$ sudo apt-get install openjdk-8-jdk
Install open jdk.
It probably works without additional variable settings.
$ java
Check if it is installed properly by typing the command above.
Install Flutter SDK
$ sudo snap install flutter --classic
Download the Flutter SDK easily by typing the command above.
In the same environment as mine, the Flutter SDK will be installed in the following folder.
/home/{account name}/snap/flutter/common/flutter
Next, add environmental variables.
You may find .bashrc file in this directory.
/home/{account name}/.bashrc
Open it with vim.
$ vim .bashrc
Add the following to the bottom of the .bashrc file:
export PATH="$PATH:/home/<your account name>/snap/flutter/common/flutter/bin"
$ source .bashrc
Reload the shell by typing the command above.
$ flutter sdk-path
Install cmdline tools
Create a folder with the following structure in the main working directory:
- Android
- cmdline-tools
- latest
- cmdline-tools
Then move the working directory to the 'latest' folder.
Cmdline-Tools
Download the cmdline-tools.zip file for Linux from the link above.
Upload the downloaded file to your Dropbox and create a download link.
At the end of the Dropbox link, There is a factor '?dl=0', which must be eliminated.
This is because the Linux shell does not recognize the '?' character.
Then copy the generated link and type:
$ wget <Link>
$ unzip <filename.zip>
If the structure like the picture above is made, it is a success.
Add the following to /home/{account name}/.bashrc:
export ANDROID_HOME="/home/<your account name>/Android"
export PATH="$PATH:$ANDROID_HOME/cmdline-tools/latest/bin/"
export PATH="$PATH:$ANDROID_HOME/emulator/"
export PATH="$PATH:$ANDROID_HOME/platform-tools/"
$ source .bashrc
Reload the shell by typing the command above.
$ sdkmanager --list
Verify that it is added correctly through the command.
Install Packages
$ sdkmanager --install "platform-tools" "platforms;android-29" "build-tools;29.0.2" "emulator" "platforms;android-28" "build-tools;28.0.3"
These are SDK packages that Flutter needs. If you enter the above command, it will be downloaded at once.
Flutter Android SDK Path
It should be set so that the path of the Android SDK can be found on the Flutter.
$ flutter config --android-sdk /home/<your account name>/Android
Flutter Licenses
$ flutter doctor --android-licenses
All you have to do is press y.
Install Chrome
$ wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
$ sudo apt install ./google-chrome-stable_current_amd64.deb
Install Android Studio
It cannot be used because there is no GUI environment anyway, but it only installs it.
$ sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386
$ sudo add-apt-repository ppa:maarten-fonville/android-studio
Conclusion
Perhaps if you have followed all of the above processes, it will be implemented without any problems.
If you follow the above process but get an error, please add a comment.
Maybe I went through it, but I forgot and didn't upload it.
Good Luck Flutter Devs!
Top comments (0)