Quantcast
Viewing all articles
Browse latest Browse all 10

Android Studio Ubuntu install [still unboxing]

A couple of days ago, I switched my working environment from Windows 7 to Ubuntu 13.04. I had to install Android Studio on this new platform as I plan to develop a couple of Android programs. The installation on Windows 7 had not been easy, but the installation on Ubuntu has been harder. Keep in mind that Android Studio is proposed as an early access preview and we are far from a stable release. If you are looking for final product, you should keep using Eclipse.

Once installed, the fresh IDE tailored for Android is pretty convenient and I have adopted it. If you are motivated by Android Studio on Ubuntu, you should not be repelled by the install process described below. Do not hesitate to share your feedback in the comments.

PREREQUISITES

Ubuntu 13.04 is delivered with a special flavor of Java, IcedTea, which is not sustained by Android Studio. It works, but you get a bunch of  warning message. You can remove IcedTea and install Oracle Java instead, or you can have both. I decided to keep IcedTea for anything else than Android Studio. I will describe below how to proceed.

Download Oracle Java Development Kit for Linux (x64 .tar.gz): here

Download Android Studio for Linux: here

STEP 1 – INSTALL ORACLE JAVA

Oracle JDK will be installed from the .tar.gz file. Keep in mind with this method, the package will not be automatically updated. You will have to do it manually. The package will be installed in the /usr/lib folder. From a terminal screen, enter the following command lines:

arnaud@hercules:~/Downloads$ tar xvfz *.tar.gz
arnaud@hercules:~/Downloads$ sudo mkdir -p /usr/lib/jvm
arnaud@hercules:~/Downloads$ sudo mv ./jdk1.7.0_25 /usr/lib/jvm

The folder name being based on the version number, it may be different. The package is now ready to use. In the next step, we will configure the environment variables to call it.

STEP 2 – UNZIP ANDROID STUDIO

From the download folder, untar the .tgz file and move it to your ~/Documents folder (or wherever you want):

arnaud@hercules:~/Downloads$ tar xvfz *.tgz
arnaud@hercules:~/Downloads$ mv android-studio ~/Documents

STEP 3 – FIX ENVIRONMENT VARIABLES

According to the community help wiki page on the environment variables, they should be set in the ~/.pam_environment configuration file. So edit or create this file with your favorite text editor and add the following lines:

STUDIO_JDK DEFAULT=/usr/lib/jvm/jdk1.7.0_25
PATH DEFAULT=${PATH}:${HOME}/Documents/Android Studio

Adapt the folder name if you are using a newer version. The first line will be read by Android Studio start script and describes which JDK to use. The second one will allow you to start Android Studio from anywhere. Check that the configuration is OK (you need to re-login):

arnaud@hercules:~$ printenv STUDIO_JDK
/usr/lib/jvm/jdk1.7.0_25

STEP 4 – FIRST RUN

You are now ready to launch Android Studio. Shoot a terminal window and enter:

arnaud@hercules:~$ studio.sh
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
[ 61068] WARN - ution.rmi.RemoteProcessSupport -
[ 61069] WARN - ution.rmi.RemoteProcessSupport - FAILURE:
[ 61071] WARN - ution.rmi.RemoteProcessSupport - Build failed with an exception.
[ 61072] WARN - ution.rmi.RemoteProcessSupport -
[ 61073] WARN - ution.rmi.RemoteProcessSupport -
[ 61098] WARN - ution.rmi.RemoteProcessSupport - * What went wrong:
[ 61098] WARN - ution.rmi.RemoteProcessSupport - Failed to notify model configuration listener.
[ 61099] WARN - ution.rmi.RemoteProcessSupport - >
[ 61100] WARN - ution.rmi.RemoteProcessSupport - No builders are available to build a model of type 'com.android.build.gradle.model.AndroidProject'.
[ 61111] WARN - ution.rmi.RemoteProcessSupport -
[ 61112] WARN - ution.rmi.RemoteProcessSupport - * Try:
[ 61112] WARN - ution.rmi.RemoteProcessSupport - Run with --stacktrace option to get the stack trace. Run with --info
[ 61113] WARN - ution.rmi.RemoteProcessSupport - or [ 61115] WARN - ution.rmi.RemoteProcessSupport - --debug
[ 61117] WARN - ution.rmi.RemoteProcessSupport - option to get more log output.

You will be probably requested to update. If not, check for update manually. Android Studio is very frequently updated. Before a recent update, I had the following error messages:

[ 9570] ERROR - tartup.impl.StartupManagerImpl - Android Studio (I/O Preview) AI-130.716844 Build #AI-130.716844
[ 9578] ERROR - tartup.impl.StartupManagerImpl - JDK: 1.7.0_25
[ 9578] ERROR - tartup.impl.StartupManagerImpl - VM: Java HotSpot(TM) 64-Bit Server VM
[ 9578] ERROR - tartup.impl.StartupManagerImpl - Vendor: Oracle Corporation
[ 9578] ERROR - tartup.impl.StartupManagerImpl - OS: Linux
[ 9578] ERROR - tartup.impl.StartupManagerImpl - Last Action:

It looks fixed now. Again, Android Studio is frequently updated. Moreover, you can send your bug report to Google. You can select the “Darcula” theme. This is purely aesthetic, but for me, that matters.

STEP 5 – CREATE VIRTUAL DEVICES

Android Virtual Devices (AVD) can be used to test your code on any platform, even if you do not own the physical device, or without the burden to connect it to your PC. Here are the typical parameters that I use:

Image may be NSFW.
Clik here to view.
Create Android Virtual Device AVD typical parameters 1024x576 Android Studio Ubuntu install [still unboxing]

Create Android Virtual Device (AVD): typical parameters

Do not use too much RAM. The snapshot option will be helpful for a faster startup process. You can also use the following value when you start an AVD:

Image may be NSFW.
Clik here to view.
Start Android Virtual Device AVD typical parameters Android Studio Ubuntu install [still unboxing]

Start Android Virtual Device (AVD): typical parameters

With the “scale display to real size”, the window will fit nicely into the screen:

Image may be NSFW.
Clik here to view.
Android Virtual Device window in Ubuntu 1024x576 Android Studio Ubuntu install [still unboxing]

Android Virtual Device window in Ubuntu

STEP 6 – ACTIVATE THE DEVICE DEBUG MODE

Final step, if you want to run your code on a physical device, you need to activate the debug mode on it:

Image may be NSFW.
Clik here to view.
Android Studio install activate debug mode 576x1024 Android Studio Ubuntu install [still unboxing]

Android Studio install: activate debug mode

Enjoy!

Image may be NSFW.
Clik here to view.
Android Studio install splash screen Android Studio Ubuntu install [still unboxing]

Android Studio install: splash screen

The post Android Studio Ubuntu install [still unboxing] appeared first on Zombie Brainz' Juice.


Viewing all articles
Browse latest Browse all 10

Trending Articles