How to Install Android Studio on Ubuntu 24.04

Android Studio is the official IDE (Integrated Development Environment) for Android development, providing powerful tools for building apps for Android devices. Ubuntu 24.04 is a solid choice for Android development due to its stability and open-source nature. If you’re a developer looking to start your Android app development journey, here’s a step-by-step guide to installing Android Studio on Ubuntu 24.04.

Prerequisites:

  • A system running Ubuntu 24.04.
  • At least 4 GB of RAM (8 GB recommended).
  • 2 GB of available disk space.
  • Java Development Kit (JDK) version 11 or later.

Step 1: Update and Upgrade Ubuntu

Before installing any new software, it’s essential to ensure your system is up to date. Open a terminal and run the following commands:

sudo apt update
sudo apt upgrade

This will fetch and install the latest package updates available for your system.


Step 2: Install Java Development Kit (JDK)

Android Studio requires the Java Development Kit (JDK) to run. You can install OpenJDK using the following commands:

sudo apt install openjdk-17-jdk

To verify that the JDK is installed correctly, check the version:

java -version

You should see output showing Java 17 is installed, which is compatible with Android Studio.


Step 3: Download Android Studio

Go to the official Android Studio download page and download the Linux version of Android Studio.

Alternatively, you can download it via the terminal using wget:

wget https://dl.google.com/dl/android/studio/ide-zips/X.X.X.X/android-studio-ide-X.X.X.X-linux.tar.gz

Make sure to replace X.X.X.X with the latest version number of Android Studio.
*** NOTE *** File structure has changed for the download link and needs to be updated on this tutorial I had to download manually from the website.


Step 4: Extract the Downloaded File

After downloading Android Studio, navigate to the directory where the file was saved and extract the file:

tar -xvf android-studio-ide-X.X.X.X-linux.tar.gz

Move the extracted folder to the /opt/ directory:

sudo mv android-studio /opt/

Step 5: Install Required Dependencies

Ensure that your system has all the necessary dependencies for Android Studio to run. Install them by running the following command:

sudo apt install lib32z1 lib32ncurses6 libbz2-1.0:i386 libstdc++6:i386

If you received the following errors please follow the instructions below, if you did not receive these errors, please move forward to Step 6:

E: Unable to locate package libbz2-1.0:i386
E: Couldn’t find any package by glob ‘libbz2-1.0’
E: Unable to locate package libstdc++6:i386

Android Studio may require certain 32-bit libraries to run on a 64-bit system. By default, 64-bit Ubuntu installations are configured only for 64-bit packages, so you’ll need to manually enable support for 32-bit architecture.

Enabling 32-bit Architecture

First, verify the currently configured architecture:

sudo dpkg --print-architecture

This should return amd64 if you’re on a 64-bit system.

Next, check for any other foreign architectures (the output should be empty):

sudo dpkg --print-foreign-architectures

Now, add 32-bit architecture support:

sudo dpkg --add-architecture i386

Verify that 32-bit architecture has been added:

sudo dpkg --print-foreign-architectures

You should see i386 listed.

Finally, update the package list to account for the new architecture:

sudo apt-get update

Installing 32-bit Libraries

Now that the 32-bit architecture is enabled, you can proceed to install the required 32-bit libraries:

sudo apt install lib32z1 lib32ncurses6 libbz2-1.0:i386 libstdc++6:i386

This section will ensure that your system is properly configured to handle the necessary 32-bit dependencies required by Android Studio.


Step 6: Launch Android Studio

Now that Android Studio is installed, it’s time to run it! Navigate to the Android Studio folder:

cd /opt/android-studio/bin

Then, start Android Studio by running the studio.sh script:

./studio.sh

This will launch the Android Studio setup wizard, which will guide you through configuring the environment, including downloading necessary SDK components.


Step 7: Create a Desktop Entry (Optional)

If you want to create a desktop shortcut for easy access, follow these steps:

  1. Create a new desktop entry:
sudo nano /usr/share/applications/android-studio.desktop
  1. Add the following content to the file:
[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
Comment=Android Studio IDE
Categories=Development;IDE;
Terminal=false
  1. Save and exit the text editor (Ctrl + X, then Y to confirm).

You should now be able to find Android Studio in your applications menu.


Step 8: Configure Android Studio

When you launch Android Studio for the first time, the setup wizard will ask you to choose your desired settings (standard or custom). It will also prompt you to download the necessary SDKs and emulators for Android development.

Follow the on-screen instructions, and once the configuration is complete, you’re ready to start developing your Android applications.


Step 9: Verify Installation

To verify everything is working correctly:

  1. Create a new Android project in Android Studio.
  2. Configure an Android Virtual Device (AVD) or connect a physical device.
  3. Build and run your project to ensure the IDE, SDK, and emulator are functioning as expected.

Conclusion

With Android Studio installed on your Ubuntu 24.04 system, you’re ready to develop and test Android applications. This guide provides the essential steps for installation, ensuring you have a smooth setup for Android development. Whether you’re building your first app or developing the next big thing, having a reliable IDE like Android Studio is key to success.

Happy coding!