Android studio

This article contains instructions for setting up Android Studio.

Pre-Installation
These pre-installation steps are required for the Android Studio Emulator program to work. Android Studio will still install and work without these steps but the Emulator will either not launch at all or will appear to be working but will give a cryptic message about "waiting for target to come online". Without these pre-installation steps that wait will be indefinite. The major things to remember are that to have a fully functioning Emulator it is required to have KVM enabled in the kernel (which means that the BIOS must support KVM), qemu installed, and pulseaudio installed.

KVM and QEMU
See QEMU article for information on how to set up KVM and install qemu.

KVM Permissions for Android Studio
QEMU should automatically create a new  group on the system and there should now be a   device.

Run this command to view all groups on the system to check if  was added:

Run this command to add the user account name which will be using Android Studio to the  group with this command:

In the above example  is the username.

To check that the user was added to the  group you can run the command:

In the above example  is the username.

Next check that  is set to the correct ownership and mode permissions. This can be done with the command:

The desired permissions are mode  and the desired ownership should be. If it's not already configured that way set the ownership and permission mode with the following commands:

Pulse Audio
See PulseAudio Article for information on how to install pulseaudio.

Files

 * - The Sdk lives here.
 * - Projects created in Android Studio are found here.

Invocation
Launch Android Studio with the command:

Emulator will not launch
Make sure the proper Sdk tools and the Emulator are installed. This can be checked by going to. Then click on the  tab and make sure that the box next to   is checked as well as the boxes next to , and.

Emulator still will not launch
Make sure an actual Android Virtual Device(AVD) has been created. Create an AVD by clicking on the green play button underneath the  menu. Then click on  and follow the instructions from Android Studio.

Emulator really still will not launch
See the pre-installation section above and make sure the system supports KVM at the bios level, KVM is enabled correctly in the kernel, qemu is installed, and pulseaudio is installed.

And see the permissions section above and make sure  is set to mode   and.

Emulator really really still will not launch
Android Studio itself may only give cryptic information or may act as though the emulator is launching but never launch it. In the terminal window Android Studio was launched from there may be vague messages about timeout reached.

To find out what's really going on with the emulator launch it directly from the. So:

Then get a list of installed AVDs(Android Virtual Devices) with the command:

Then try launching an AVD with the command:

Where  is an example AVD name.

Pay attention to the terminal and see if it lists any error messages about missing libraries or other information. This approach was helpful in determining the pulseaudio requirement.

Emulator really really really still will not launch
Check in Android Studio Event Log, if you don't see something like:. If so, go to or  if on 32-bit system, backup libstdc++.so.* files you will find there and make symbolic link to your own system libstdc++.so.6, for example:

Running Intel x86 Atom images on processors without ssse3 support you may also see warning, but images up to API 22 are known to work despite of it (newer don't work). For Intel x86 Atom_64 images warning is:.

Emulator really really really really still will not launch
"Have you tried unplugging your Gentoo and then plugging it back in?"

Seriously a system reboot might fix the issue so it's worth a shot at this point. Another thing to try is removing the emulator and the SDK and then reinstalling them. Also double check that all the pre-installation stuff was installed and configured correctly.