Unable to install Android Studio in Ubuntu

JavaAndroidUbuntuAndroid Studio64 Bit

Java Problem Overview


I'm using Ubuntu Gnome 14.04, and I have Java 8 installed (both the JDK and the JRE).

When I was installing Android Studio everything worked, but a message appeared saying:

>Unable to run mksdcard SDK tool

How can I install Android Studio correctly, or how do I fix this ?

Java Solutions


Solution 1 - Java

Presuming that you are running the 64bit Ubuntu, the fix suggested for "Issue 82711" should solve your problem.

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

Update: For Ubuntu 15.10 & 16.04 sudo apt-get install lib32z1 lib32ncurses5 lib32stdc++6

Solution 2 - Java

@warsong is right. Installing only lib32stdc++6 solved the problem.

For next uses I rewrite @warsongs comment in answer area.

sudo apt-get install lib32stdc++6

Update :

For Ubuntu 15.04,15.10,16.04 LTS & Debian 8

Solution 3 - Java

For Fedora (tested for Fedora 23/24) run

dnf install compat-libstdc++-296 compat-libstdc++-33 glibc libgcc nss-softokn-freebl libstdc++ ncurses-libs zlib-devel.i686 ncurses-devel.i686 ant

Solution 4 - Java

I understand the question is regarding UBUNTU, but I had similar problem in Debian Jessie 64bit and warsongs suggestion worked for it also.
When I ran studio.sh android studio would start, but when I tried to configure the android SDK I got the error
Unable to run mksdcard SDK tool
WHen I tried
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6
Got error
E: Package 'lib32bz2-1.0' has no installation candidate
So took warsongs suggestion and only tried to install lib32stdc++6.
sudo apt-get install lib32stdc++6
After this was able to add the Android SDK into Android Studio.

Solution 5 - Java

Checkout this page

> If you are running a 64-bit distribution on your development machine, you need to install additional packages first. For Ubuntu 13.10 (Saucy Salamander) and above, install the libncurses5:i386, libstdc++6:i386, and zlib1g:i386 packages using apt-get:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386

Solution 6 - Java

The Problem is caused by mksdcard not being installed correctly.

if you are running 64 bit, do this to fix the mksdcard problem.

    sudo dpkg --add-architecture amd64
    sudo apt-get update
    sudo apt-get install libncurses5:amd64 libstdc++6:amd64 zlib1g:amd64

and 32 bit:

    sudo dpkg --add-architecture i386
    sudo apt-get update
    sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386

In SDK 6.0, the error message is different but means the same thing.

    Unable to run mksdcard

Solution 7 - Java

None of these options worked for me on Ubuntu 12.10 (yeah, I need to upgrade). However, I found an easy solution. Download the source from here: https://github.com/miracle2k/android-platform_sdk/blob/master/emulator/mksdcard/mksdcard.c. Then simply compile with "gcc mksdcard.c -o mksdcard". Backup mksdcard in the SDK tools subfolder and replace with the newly compiled one. Android Studio will now be happy with your SDK.

Solution 8 - Java

For Linux Mint run

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

Solution 9 - Java

If you run sudo apt-get install lib32z1 lib32ncurses5 libbz2-1.0 lib32stdc++6 and got a message like: "The following packages have unmet dependencies: lib32stdc++6 : Depends: lib32gcc1 (>= 1:4.1.1)".

You can do something like this tut: https://askubuntu.com/questions/671791/lib32stdc6-package-depends-on-gcc-base-but-my-installed-version-is-newer

Solution 10 - Java

This issue arises when your 64 bit os tries to install the Android SDK which in turns tries to install some 32 bit binaries and thus is the issue of compatibility.

Open an additional terminal and type

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

would help to install all the required binaries. After this, start the afresh the Android SDK installation process.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionCarlos CarrizalesView Question on Stackoverflow
Solution 1 - JavaRajeshView Answer on Stackoverflow
Solution 2 - JavaSayemView Answer on Stackoverflow
Solution 3 - JavaTimo BährView Answer on Stackoverflow
Solution 4 - JavadrlollyView Answer on Stackoverflow
Solution 5 - JavasudozView Answer on Stackoverflow
Solution 6 - JavaKyler ChinView Answer on Stackoverflow
Solution 7 - JavamjancolaView Answer on Stackoverflow
Solution 8 - JavaBit-ManView Answer on Stackoverflow
Solution 9 - JavaanhnvView Answer on Stackoverflow
Solution 10 - JavaSelvaperumalView Answer on Stackoverflow