Installing Android Studio on Ubuntu 14.04

12:35

Overview Android Studio

Android Studio is an Integrated development environment (IDE) distributed by Google. This new IDE helped Android developers in creating their application and is capable of supporting, designing, testing and debugging.

In this blog post, I will show you my approach on installing Android Studio and hopefully help you get started in building your android applications. However, before installing Android Studio on your machine, you need to have JDK (Java Development Kit) 6 or higher and JDK 7 is required for Android 5.0 and higher.  To see the version of JDK on your machine, open a terminal and type:

java -version

If no version is found then the next section shows how to install JDK7.

Installing Oracle Java 7

There are plenty ways to install JDK 7 and are available on Ubuntu Community Java. The simplest way through a terminal window so open one and follow these steps:

1. Add Repo
sudo apt-add-repository ppa:webupd8team/java


2. If you encountered this error:
bash: apt-add-repository: command not found

3. Install software-properties-common
apt-get install software-properties-common
  
4. Re-try to add Repo
sudo apt-add-repository ppa:webupd8team/java

5. Update Repo
sudo apt-get update


6. Installing Oracle Java 7


sudo apt-get install oracle-java7-installer


7. To automatically set up Java 7 environment variables JAVA_HOME and PATH


sudo apt-get install oracle-java7-set-default


8. Check Version


java -version

Installing Android Studio

Click this link (Installation page for Android Studio), scroll down to the bottom of the page until you see the title "All android Studio Packages", and download the Android Studio packages for Linux.

1. Unpack the downloaded ZIP file into an appropriate location. In my case, I have extracted to directory /opt/ because as it is easier for me to locate this directory.

2. To run Android Studio on Ubuntu, go to the folder you extracted in a terminal, Example:
cd /opt/android-studio/bin/
ls

This folder should have a file called studio.sh . The studio.sh is a script that will execute Android Studio.

3. At this point you should be on directory /opt/android-studio/bin/ and execute studio.sh in the terminal by typing:

./studio.sh

After executing studio.sh, the application should start running as shown in the figure below:


Congratulations! You installed Android Studio but we are not done yet, we still need to configure a little bit more and make sure Android Studio can run in any directory we are in. To do this, we need to add the full path of Android Studio directory in to your PATH  in the environmental variable. In a terminal type:

sudo vi /etc/environment 
 
Just add your studio.sh directory to the end of the PATH value, restart your machine and you should be able to run studio.sh globally. Your new path should similar to the image below:



Error Encountered


If you encounter the error shown in figure above then to fix this issue, you need to have some 32-bit binaries and have a 64-bit OS (Operating System) version. Try:

sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6

After installing some 32-bit binaries the error is fixed and this method worked on Ubuntu 14.10 and 14.04. Depending on your project the Android Studio Manager should pop up and give you the decision to install other resources need for your project.

That's it for now. Share, subscribe, comment below with questions or suggestions or errors that you found and fixed. 

You Might Also Like

0 comments

Couch Jumping