Complete Guide to Installing Android Studio on Ubuntu Systems

Nov 25, 2025 · Programming · 9 views · 7.8

Keywords: Android Studio | Ubuntu Installation | Java Configuration | SDK Management | Development Environment

Abstract: This article provides a comprehensive guide for installing Android Studio on Ubuntu systems, covering Java environment configuration, Android Studio download and installation, SDK platform setup, and solutions to common issues. Based on community best practices, it offers complete instructions from basic environment preparation to development environment configuration, with special attention to compatibility requirements for 64-bit Ubuntu systems, helping developers quickly set up Android development environments.

Environment Preparation and Dependency Installation

Before starting the Android Studio installation, ensure the system meets necessary runtime environment requirements. First, install the Java Development Kit (JDK), as Android Studio 1.0 and later versions require JDK 1.7 or higher. Oracle JDK is recommended and can be installed via the WebUpd8 team's PPA:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default

After installation, verify JDK installation success using the javac -version command. Note that the WebUpd8 team's PPA was discontinued in April 2019, so alternative JDK installation methods may be needed in practice.

System Compatibility Library Installation

For 64-bit Ubuntu systems, additional 32-bit compatibility libraries are required to ensure proper operation of Android development tools. These libraries include basic C runtime libraries, terminal control libraries, C++ standard libraries, etc.:

sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386

These 32-bit libraries are crucial for certain tools in the Android SDK (such as mksdcard). Missing these dependencies may prevent tools from starting properly. Installing these libraries effectively avoids common compatibility issues.

Android Studio Installation Process

After downloading the Linux version of Android Studio from the Android developer website, decompress and configure it. It is recommended to install Android Studio in a system-level directory for multi-user access:

sudo unzip android-studio-ide-135.1641136-linux.zip -d /opt/
cd /opt/android-studio/bin
./studio.sh

After decompression, navigate to the android-studio/bin directory and execute the studio.sh script to start Android Studio. The first launch will run a setup wizard to guide users through initial configuration.

SDK Platform and Tool Configuration

After Android Studio starts, necessary development tools and platforms must be installed via the SDK Manager. Click "Configure" -> "SDK Manager" from the welcome screen to open the Android SDK Manager:

# Select the latest API platform (e.g., API 19 for Android 4.4.2)
# Install Android Support Library and Android Support Repository from Extras
# Choose required build tools and platform tools

It is advisable to install at least the latest API platform and corresponding system images for application testing. Additionally, the Android Support Library provides backward-compatible API support, which is essential for developing applications compatible with different Android versions.

Environment Variable Configuration and Optimization

To facilitate using Android development tools from the command line, configure relevant environment variables. Edit the user profile file:

# Edit ~/.profile file
gedit ~/.profile

# Add the following content
export ANDROID_HOME=${HOME}/Android/Sdk
export PATH="${ANDROID_HOME}/tools:${PATH}"
export PATH="${ANDROID_HOME}/emulator:${PATH}"
export PATH="${ANDROID_HOME}/platform-tools:${PATH}"

After configuration, log out and log back in or execute source ~/.profile to apply the changes. This allows using Android development tools like adb and fastboot from any directory.

Desktop Shortcut Creation

For daily convenience, create a desktop launcher for Android Studio. This can be done using Android Studio's built-in functionality:

# In Android Studio
Tools -> Create Desktop Entry

Or manually create a desktop file:

nano ~/.local/share/applications/androidstudio.desktop

# Add the following content
[Desktop Entry]
Version=1.0
Type=Application
Name=Android Studio
Exec="/opt/android-studio/bin/studio.sh" %f
Icon=/opt/android-studio/bin/studio.png
Categories=Development;IDE;
Terminal=false
StartupNotify=true
StartupWMClass=android-studio

Common Issues and Solutions

Various issues may arise during installation. Here are solutions to some common problems:

32-bit Library Missing Error: If encountering "Unable to run mksdcard SDK tool" error, it is usually due to missing 32-bit compatibility libraries. Reinstall the aforementioned 32-bit libraries.

Java Version Compatibility Issues: Ensure the JDK version meets Android Studio requirements. Adjust the JDK path in Android Studio settings if necessary.

Permission Issues: If facing file permission-related errors, try running Android Studio with sudo privileges or adjust permissions for relevant directories.

Alternative Installation Methods

Besides manual installation, consider other installation approaches:

Snap Package Installation: Ubuntu 16.04 and later support installing Android Studio via snap packages:

sudo snap install --classic android-studio

This method automatically handles all dependencies, including Java environment configuration, simplifying the installation process.

PPA Installation: Some third-party PPAs offer packaged versions of Android Studio, but be cautious of the PPA's maintenance status and security.

Copyright Notice: All rights in this article are reserved by the operators of DevGex. Reasonable sharing and citation are welcome; any reproduction, excerpting, or re-publication without prior permission is prohibited.