Development of mobile applications for the Android operating system requires powerful and flexible tools, and Android Studio is the official industry standard in this area. For developers who prefer open source software, the operating system Ubuntu provides an ideal environment due to its stability and excellent support for Java packages. However, the process of initially setting up an IDE on Linux distributions can raise questions for beginners, especially in matters of dependency management and emulator configuration.
Unlike Windows or macOS, where installers often hide the complex processes of setting paths and environment variables, in Linux the user has to interact more often with the terminal. This gives complete control over exactly how run android studio ubuntu and what system resources will be allocated for code compilation. Correct installation is critical to the performance of project builds and the speed of virtual devices.
This guide will cover in detail all the stages: from checking system requirements to solving common errors when starting the emulator. We will look at both installing through the official archive and using a package manager Snapso that you can choose the most suitable option for your workflow. Understanding these nuances will allow you to avoid typical problems with access rights and the lack of necessary libraries.
Preparing the system and checking requirements
Before you start downloading the distribution, you need to make sure that your operating system meets the minimum developer requirements. Android Studio is a heavyweight application that consumes a significant amount of RAM, especially when running with an emulator. For comfortable work, it is recommended to have at least 8 GB of RAM, although the absolute minimum is 4 GB, which often leads to interface sluggishness.
A critically important component is the presence of an installed runtime environment Java Development Kit (JDK). Modern versions of Android Studio often come with a built-in version of the JDK, but some plugins and command line tools may require a system installation to work. You can check for Java by entering the command java -versionin the terminal. If the system does not find the command, you will need to install the open version through the repository.
โ ๏ธ Attention: Make sure that you have at least 4 GB of free space on your hard drive just for the IDE itself, not counting space for projects, the Gradle cache and images of Android system versions, which can take up tens of gigabytes.
It is also worth checking the architecture of your processor. Although support for 32-bit systems is slowly becoming a thing of the past, most modern tools require a 64-bit architecture. Run the command uname -m in the terminal: the output should contain x86_64. If you are using an ARM processor (for example, on some laptops or single board computers), the emulator installation process will be different and will require additional configuration.
Ways to install Android Studio on Ubuntu
There are several main methods for installing an integrated development environment on Ubuntu, each of which has its own advantages and disadvantages. The specific method you choose depends on your preferences for managing updates and isolating applications. Let's consider the two most popular options: installation via the official tar archive and using the Snap package.
The first method is downloading the official archive from the developer's website. This method gives you full control over the software version and file location. You can install multiple versions of the IDE in parallel to test plugin compatibility. However, in this case, the system will not automatically update the app, and you will have to manually download new releases.
The second method is to use the application store Snap, which is pre-installed in modern versions of Ubuntu. This approach simplifies the process as much as possible: installation is performed with one command, and updates occur automatically in the background. The main advantage of Snap packages is dependency isolation, which prevents library conflicts with other apps on the system.
For users who value stability and predictability of the environment, manual installation from an archive is often recommended. This allows you to clearly control which libraries are used during compilation. At the same time, for those who want to focus on the code and not on system administration, the package snap will be the optimal choice, eliminating routine path settings.
Step-by-step installation through the official archive
Let's start with the classic installation method, which is considered the most reliable for professional development. First, you need to download the current distribution from the official developer portal. Select the option for Linux (64-bit), which usually comes in the format .tar.gz. After the download is complete, the file should be moved to a convenient directory, for example, to your home folder or temporarily to /tmp.
Next you need to unpack the archive. Open a terminal and go to the directory with the downloaded file. Use the tar command to extract the contents. It is important to specify the correct destination path so that the IDE files do not get mixed up with other data. Typically, developers create a special folder in the home directory, for example ~/android-studio, where they place the unpacked files.
tar -xzf android-studio-*.tar.gz -C ~
After unpacking, you need to run the installation script. Go to the created directory android-studio/bin and execute the file studio.sh. It is this script that initiates the initial setup wizard, which will check for the presence of the necessary components and offer to import the settings if you have previously used the IDE on another computer.
โ๏ธ Installation checklist
At the first launch, the wizard will prompt you to select the installation type: Standard or Custom. For most users, the standard option is suitable, which will automatically configure the theme and download the necessary SDK components. If you require a specific emulator configuration or a non-standard SDK location, select the Custom mode and carefully follow the proposed paths.
Configuration via the Snap package manager
If you prefer centralized application management, installation via Snap is the fastest solution. On Ubuntu, this tool is already integrated into the system, so you won't need to add third-party repositories. Just open a terminal and enter the installation command, after which the package manager will automatically download all the necessary dependencies.
sudo snap install android-studio --classic
Key --classic is critically important in this team. It provides the application with wider access to the userโs file system, which is necessary for working with projects located in the home directory and for the correct functioning of the emulator. Without this flag, the IDE may run in an isolated sandbox, which will result in errors when trying to save files or launch a virtual device.
โ ๏ธ Warning: When installing via Snap, access rights to some system resources may be limited by the container's security policy. If the emulator won't start, check the permissions in Snap's settings or consider manual installation.
Once the installation is complete, the app shortcut should appear in the apps menu. The launch is carried out in the standard way through the graphical interface or by command android-studio in the terminal. The main advantage of this approach is automatic updating. As soon as Google releases a new version with security fixes or new features, the system itself will update the package without your intervention.
If, after installing via Snap, you receive permission errors when creating projects, try running the IDE once with superuser rights through the sudo command so that it creates the necessary configuration files in protected directories.
Primary configuration and wizard settings
When you launch it for the first time, regardless of the installation method, you will see the Welcome to Android Studio window. This is where the initial configuration of the environment occurs. The wizard will prompt you to check for updates for the IDE itself and SDK components. It is highly recommended agree to install all available updates at this stage to avoid compatibility problems in the future.
The next step is to select a theme. You can choose a light theme (IntelliJ Light) or a dark theme (Darcula), which is popular among developers for reducing eye strain when working at night. Also at this stage you can adjust the code editor font and interface size, which is especially important for high-resolution 4K monitors.
The most important step is setting up the emulator. You will be prompted to download a system image. Select a stable version of Android, for example, the latest stable release version or the one for which you plan to develop the application. Pay attention to the architecture of the image: for Intel and AMD processors, choose x86_64, as they work much faster thanks to hardware virtualization.
| Component | Description | Recommendation |
|---|---|---|
| Android SDK | Build toolkit | Install by default |
| Android SDK Platform | Files of a specific Android version | Select the latest stable one |
| Android Emulator | Virtual device | Required to install |
| Android SDK Build-Tools | Utilities compilation | Latest version |
The final step of the wizard is to accept the license agreements. You will have to scroll through the license text for each SDK component and confirm your acceptance. Without accepting these conditions, projects will not be able to compile because Gradle will not be able to load the necessary libraries. After clicking the Finish button, the selected components will begin downloading, which may take some time depending on the speed of the Internet connection.
Solving problems with the emulator and KVM
One โโof the most common problems when working with Android Studio on Linux is the inability to run the emulator due to the lack of rights to use virtualization technologies. The fast emulator is based on the kernel module KVM (Kernel-based Virtual Machine). If this module is not activated or the current user does not have rights to access the device /dev/kvm, you will receive an error when starting the virtual device.
To check the KVM status, run the command kvm-okin the terminal. If the system reports that KVM acceleration can be used, it means that the processor and BIOS are configured correctly. However, it often happens that the user is not added to the group kvm. To fix this, use the command sudo usermod -aG kvm $USER. After executing this command, you must log out and log in again or restart the computer.
What to do if kvm-ok gives an error?
If the utility reports that KVM is not available, check the BIOS/UEFI settings of your computer. Find the section responsible for the processor (CPU Configuration) and make sure that virtualization technologies are enabled: Intel VT-x or AMD-V. Without enabling this option in the BIOS, the emulator will not work.
Another common problem is related to the library libstdc++. In some Ubuntu distributions, the emulator may not start due to the lack of 32-bit versions of the libraries, even if the system itself is 64-bit. In this case, you will need to install compatibility packages by running the command sudo apt-get install libstdc++6:i386. This will ensure that all the necessary symbols are available to run the emulator binary files.
โ ๏ธ Attention: BIOS settings interfaces and names of virtualization options may differ depending on the motherboard manufacturer. If you don't find the option you need, check the documentation for your hardware.
If the emulator starts but is extremely slow, check the RAM allocation. In the settings of the virtual device (AVD Manager) you can change the amount of RAM. You should not allocate too much memory so as not to โchokeโ the main system, but a minimum of 2 GB may not be enough for modern versions of Android. The optimal value is 4 GB if there is 16 GB of total memory in the system.
Successful launch of the emulator on Ubuntu is impossible without an active KVM module and adding the user to the appropriate group. This is a fundamental requirement of the Linux architecture for virtualization.
Performance optimization and useful plugins
After successfully launching your development environment, it is worth taking time to optimize it for your tasks. Android Studio is built on the IntelliJ IDEAplatform, which is famous for its flexibility. You can configure settings for the Java virtual machine that runs the IDE itself to speed up file indexing and code inspectors. This is done through the file studio.vmoptionslocated in the configuration directory.
Increasing the maximum heap size (Heap Size) can significantly improve the responsiveness of the interface when working with large projects. Find the line -Xmx and change the value, for example, to 2048m or 4096mif you have enough free RAM. Be careful: setting the value too high may cause other applications on the system to become unstable.
It's also worth paying attention to the plugin ecosystem. The built-in JetBrains marketplace offers many extensions to make a developer's life easier. Some of the most useful include plugins for working with Git, code analysis tools, and themes. Installing additional plugins allows you to adapt the environment to a specific technology stack, be it Flutter, Kotlin Multiplatform or pure Java.
- ๐ Key Promoter X โhelps to remember hotkeys by showing hints when using the mouse.
- ๐จ Material Theme UI โexpands the possibilities for customizing the interface, offering modern color schemes.
- ๐ String Manipulation โa powerful tool for working with text, allowing you to quickly change case, encode strings and sort data.
Do not forget to regularly clear the system cache. Over time, file indexing and temporary data can take up gigabytes of space and slow down your work. Use the built-in function File โ Invalidate Caches / Restartif you notice strange behavior in the IDE, such as compilation errors not being displayed or problems with code completion. This action is safe and often solves many mysterious problems.
Frequently asked questions
Is it possible to run Android Studio on Ubuntu without installing the JDK?
Yes, modern versions of Android Studio (from 2.2) come with a built-in version of the JDK required for the IDE itself to work and project builds. However, for some specific tasks or working with other command line tools, the system JDK may be required.
Why does the emulator give the error "No accelerator found"?
This error means that the IDE cannot find the KVM hardware virtualization module. Make sure that virtualization is enabled in the BIOS, the kvm module is loaded into the kernel, and your user is added to the kvm group with the command sudo usermod -aG kvm $USER.
How to remove Android Studio installed through Snap?
To completely remove the version installed through the Snap package manager, run the command sudo snap remove android-studioin the terminal. This will remove the application and its associated data within the Snap container.
Where are projects stored by default in Ubuntu?
By default, Android Studio suggests saving projects in a folder AndroidStudioProjects inside your home directory (/home/username/AndroidStudioProjects). You can change this location in the settings when creating a new project.