39

I'm trying to install Android Studio on a 64-bit Fedora 21 system.

I got the JRE and JDK pre-requisites installed, unpacked the Android Studio installation, and from its "bin" directory issued "sh studio.sh" to complete the installation.

The Setup Wizard failed with message "Unable to run mksdcard SDK tool" and suggested that 32-bit libraries might be needed.

mcduffee
  • 1,237
  • 1
  • 10
  • 14
  • 2
    This bug is known upstream as [82711](https://code.google.com/p/android/issues/detail?id=82711) There's a similar question for Ubuntu/Debian [Unable to install Android Studio in Ubuntu](http://stackoverflow.com/q/28847151/1260896). – Franklin Piat Apr 03 '15 at 21:01
  • 3
    Possible duplicate of [Error: Unable to run mksdcard SDK tool in ubuntu](http://stackoverflow.com/questions/29241640/error-unable-to-run-mksdcard-sdk-tool-in-ubuntu) – tripleee Aug 11 '16 at 09:49

7 Answers7

59

(This answer is for an Ubuntu distribution)

If you are running the 64-bit Ubuntu, the following fix should solve your problem:

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

UPDATE:

For Ubuntu 15.10 and 16 (Provided by tony gil and briankip) :

sudo apt-get install lib32z1 lib32ncurses5 lib32stdc++6

This also works on GNU/Linux Debian 9 (Stretch) x86_64.

Manish M Demblani
  • 910
  • 1
  • 10
  • 21
  • 4
    Okay, but there are several answers already for questions which reference this problem on Ubuntu, and this question specified Fedora. Since the solutions are not the same on the two operating systems, I'm not sure your answer clarifies more than it confuses. – mcduffee Mar 25 '15 at 12:14
  • 8
    This question is about Fedora. for Debian/Ubuntu, see http://stackoverflow.com/q/28847151/1260896 – Franklin Piat Apr 03 '15 at 20:47
  • 7
    on ubuntu 15.10 i had to change this to `sudo apt-get install lib32z1 lib32ncurses5 lib32stdc++6` – tony gil Apr 19 '16 at 16:46
  • On Ubuntu 16 I removed lib32bz2-1.0 since it seems it's not available in the repositories, so `sudo apt-get install lib32z1 lib32ncurses5 lib32stdc++6 ` – briankip Jul 27 '16 at 12:26
  • Using this command i had issue. Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package lib32bz2-1.0 E: Couldn't find any package by glob 'lib32bz2-1.0' E: Couldn't find any package by regex 'lib32bz2-1.0' – Prasad Jul 04 '17 at 11:55
  • @mcduffee From comments in this answer we can tell that Ubuntu has much more users than Fedora... – Franklin Yu Oct 12 '17 at 02:07
  • @Franklin Yu: I suppose. I haven't used Fedora for a couple of years, and am mostly on Ubuntu myself these days. I guess, with the passage of time, I'm glad the hordes of Ubuntu folks who couldn't find the hordes of Ubuntu solutions on StackOverflow were at least able to get the help they so desperately needed. – mcduffee Oct 20 '17 at 21:21
40

From a discussion of the problem at http://forums.fedoraforum.org/showthread.php?t=303238 I installed several packages with the command

sudo yum install compat-libstdc++-296.i686 compat-libstdc++-33.i686 ncurses-libs.i686 compat-libstdc++-33.x86_64

After these (and their dependencies) were successfully installed, clicking "RETRY" in the Setup Wizard popup displaying the error allowed the installation of Android Studio to proceed to a successful completion.

smunk
  • 314
  • 3
  • 8
mcduffee
  • 1,237
  • 1
  • 10
  • 14
  • 1
    Bug [82711](https://code.google.com/p/android/issues/detail?id=82711) has some more information. – Franklin Piat Apr 03 '15 at 20:52
  • 1
    this also worked with my CentOS7 (without compat-libstdc++-296.i686). – Sproffer Jul 04 '15 at 20:54
  • 2
    Thanks @DenysVitali, unfortunately this did not work for me. I had to turn on multilib support first. This is due to the three lib32 library dependencies, which are: lib32-fontconfig, lib32-libxrender and lib32-mesa. If you are running a 32 bit arch system, these will be called fontconfig, libxrender and mesa – mateuszb Feb 26 '16 at 19:00
  • Same problem. Worked on Fedora 25 as well. – Paritosh Jan 13 '17 at 17:57
17

The Fedora Project Wiki also has an article about how to set up Android Development.

For 64-bit systems, you will have to install these packages

yum install glibc.i686 glibc-devel.i686 libstdc++.i686 zlib-devel.i686 ncurses-devel.i686 libX11-devel.i686 libXrender.i686 libXrandr.i686

For Fedora 22+ on a 64-bit system, you need to use dnf to install these packages

dnf install glibc.i686 glibc-devel.i686 libstdc++.i686 zlib-devel.i686 ncurses-devel.i686 libX11-devel.i686 libXrender.i686 libXrandr.i686

Paul Robertson
  • 170
  • 1
  • 7
  • Worked for me too. Thanks a lot . – Mahdi Shabani Dec 26 '16 at 11:57
  • You don't actually needs those `-devel` packages. `glibc.i686 libstdc++.i686 zlib.i686 ncurses.i686 libX11.i686 libXrender.i686 libXrandr.i686` suffice, and are much smaller. Anyway the wiki link is great. – Franklin Yu Oct 12 '17 at 01:50
4

Other answers here doesn't seem to work for the Fedora. So here I came up with a tested solution for this :

sudo dnf install compat-libstdc++-296 compat-libstdc++-33 glibc libgcc nss-softokn-freebl libstdc++ ncurses-libs zlib-devel.i686 ncurses-devel.i686 ant
Amit Upadhyay
  • 7,179
  • 4
  • 43
  • 57
1

Even i got the same error while installing Android sdk in ubuntu 14.04. This is a compatibility issue where you're trying to install Android SDK in a 64 bit system which inturn requires some 32 bit binaries for completing the installation.

Here is the steps to resolve the issue.

  1. Open the a new terminal (ctrl + alt +t or R-click and new terminal)
  2. paste the command " sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6 " and if action requires password, give it.

Thats it. All the required 32bit binaries will get installed. once it gets installed, you can restart the installation of Android SDK, which will get installed completely.

Find the Tutorial here!

Selvaperumal
  • 667
  • 5
  • 11
0

on Fedora 24 login with su

dnf install compat-libstdc++-296 compat-libstdc++-33 glibc libgcc nss-softokn-freebl libstdc++ ncurses-libs zlib-devel.i686 ncurses-devel.i686 ant
Termininja
  • 6,620
  • 12
  • 48
  • 49
0

Please refer on this official documentation https://developer.android.com/studio/troubleshoot.html#linux-libraries

Shortly i put the snippets here

Linux libraries

If you are running Android Studio on a 64-bit Linux machine, you may need to install some specific libraries, as follows.

If you are running a 64-bit version of Ubuntu, you need to install some 32-bit libraries with the following command:

sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 lib32bz2-1.0

If you are running 64-bit Fedora, the command is:

sudo yum install zlib.i686 ncurses-libs.i686 bzip2-libs.i686

Please note that those instructions can be obsolete someday, so it is better to follow / visit the official site to prevent unresolved problems

Community
  • 1
  • 1
Aditya Kresna Permana
  • 11,869
  • 8
  • 42
  • 48