97

Is it possible to develop using the Android SDK on a 64-bit linux machine. The available SDK downloads seem to be just for 32-bit versions of Linux.

D R
  • 21,936
  • 38
  • 112
  • 149

15 Answers15

182

On (K)Ubuntu you need following 32-bit packages:

sudo apt-get install libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386

for running the emulator you need that additional package:

sudo apt-get install libsdl1.2debian:i386
notz
  • 2,458
  • 2
  • 15
  • 11
  • 12
    A great THANK YOU for this answer, you saved my computer from installing ia32-libs (advised everywhere), which along with packages you mentioned brings a wagon of other useless dependencies. Your solution worked for my Linux Mint 13. – pavel_kazlou Sep 20 '12 at 20:55
  • Agree with commenter above, ubuntu 12.04 64bit – Matthew Gilliard Oct 15 '12 at 19:46
  • 4
    Worked for my Ubuntu 12.10 64bit. Thanks so much! –  Nov 01 '12 at 21:26
  • Confirmed working on Mint 13 x64. ~100 megs to download if "sudo apt-get ia32-libs" used, about 8 meg downloaded with the two commands you've given. Brilliant! :) Thank-you very much. – enhzflep Feb 21 '13 at 14:05
  • Saved me some valuable time.(Ubuntu 12.10 64bit) – Herks Mar 07 '13 at 11:54
  • 1
    Ubuntu 13.04 64 bit still has the same problem with the ADT SDK, and this solution also worked for me there. – GrandOpener Aug 03 '13 at 16:07
  • 2
    Works for Ubuntu 14.04 64bit too. Muchas Gracias! – Langley May 28 '14 at 00:07
  • Confirmed for Kubuntu 14.04 64-bit. This fixed my build error: error while loading shared libraries: libz.so.1 – gregtzar Aug 19 '14 at 00:13
  • Able to create a Virtual Device, but doesn't launch the emulator on 4.8.0-32-generic #34-Ubuntu x86_64 x86_64 x86_64 GNU/Linux – Joseph Dec 29 '16 at 01:28
42

Yes, it is. You need to install the ia32 libraries. Check out the Ubuntu Linux troubleshooting section.

apt-get install ia32-libs
apt-get install sun-java6-jdk
Matt Huggins
  • 81,398
  • 36
  • 149
  • 218
  • 5
    ia32-libs would not install on my machine. See notz's answer below. – Matthew Gilliard Oct 15 '12 at 19:47
  • 5
    This is only appropriate for Ubuntu versions before they brought in Multiarch support. The correct approach is now [to install the right i386 packages](http://stackoverflow.com/a/10473415/22107) – Jacob Apr 01 '13 at 12:22
  • Ironic that the "correct" answer is only correct for that fraction of 64-bit machines running Ubuntu/Gnome. Linux's fragmentation suggests the "correct" answer is a more general one or a combination of all of the following partially correct answers. I for one prefer the more generalized answer, as there are too many possible variations and updates to be sure of completeness and non-obsolescence. My vote would be for a nice "Yes it's possible. RTFM and install the 32-bit/i386 packages.", style vendor-neutral answer. FYI - they won't fix it because they want us to use Android Studio instead. – Sinthia V Nov 21 '15 at 20:29
  • No troubleshooting section on this link anymore, this goes to current install instructions: https://developer.android.com/studio/install.html select 'linux' on the top right platform selection box. – amotzg Jul 06 '17 at 06:35
34

Android SDK requires:

  • Fedora 17 64bit with Android SDK:

    sudo yum install glibc.i686 zlib.i686 libstdc++.i686 ncurses-libs.i686
    
  • Fedora 20 64bit with Android SDK

    sudo yum install glibc zlib libstdc++ ncurses-libs mesa-libGL-devel adb
    
MariuszS
  • 30,646
  • 12
  • 114
  • 155
  • 1
    thanks for the fedora specific info. the official help only has the ubuntu packages listed – gspatel May 19 '12 at 19:23
  • 2
    When I first tried this I got "Error: Protected multilib versions: libstdc++-4.7.2-2.fc17.i686 != libstdc++-4.7.0-5.fc17.x86_64". Fixed with yum upgrade libstdc++ – pinoyyid Oct 14 '12 at 15:36
  • 1
    the command line used for fedora 17 still works for fedora 21 – Sombriks Feb 12 '15 at 18:02
  • @MariuszS, in that second scenario, can you clarify what you mean by "64bit Android SDK". My understanding is that the Android SDK has 32-bit binaries, which is why we have this problem in the first place. – Carlos Macasaet Aug 21 '15 at 02:54
  • I'm not sure, but probably some time ago there two versions (bundled with eclipse 64bit probably). Answer updated – MariuszS Aug 21 '15 at 06:42
16

For Debian Wheezy you have to enable multiarch and then install the dependent libraries as listed in the other answers or as needed by the binaries from the tools or platform-tools directory:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386

For further libs check with ldd for referenced .so-files.

platform-tools$ ldd adb                       
    linux-gate.so.1 =>  (0xf77bb000)
    librt.so.1 => /lib/i386-linux-gnu/i686/cmov/librt.so.1 (0xf779b000)
    libncurses.so.5 => not found
    libpthread.so.0 => /lib/i386-linux-gnu/i686/cmov/libpthread.so.0 (0xf7781000)
    libstdc++.so.6 => not found
    libm.so.6 => /lib/i386-linux-gnu/i686/cmov/libm.so.6 (0xf775b000)
    libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xf773e000)
    libc.so.6 => /lib/i386-linux-gnu/i686/cmov/libc.so.6 (0xf75db000)
    libdl.so.2 => /lib/i386-linux-gnu/i686/cmov/libdl.so.2 (0xf75d6000)
    /lib/ld-linux.so.2 (0xf77bc000)

So continue to install libncurses5:i386 and libstdc++6:i386 to be able to run

platform-tools$ ./adb 
Android Debug Bridge version 1.0.31
...
sebastianwagner
  • 399
  • 2
  • 9
  • Thanks @user2255304! This worked for me. Was trying to install Android Studio and `android-studio/sdk/tools/mksdcard` was a 32 bit executable. Followed steps above and installed `libc6:i386` and `libstdc++6:i386`. The binary is now working fine. – Rajkumar S Mar 12 '14 at 07:59
9

For Ubuntu 13.1 ia32-libs is not available anymore. So, you can try this one:

sudo apt-get install lib32z1 lib32ncurses5 lib32stdc++6
user1079877
  • 9,008
  • 4
  • 43
  • 54
  • These package names also work for Ubuntu 14.04. This appears to me to be the 'correct' approach because these packages come from the amd64 architecture repo. The earlier comment suggesting installing :386 packages mixes architecture packages which seems risky. – Don Park Jul 29 '14 at 15:27
  • @DonPark No, it is not risky. It is called multiarch. – Léo Lam May 01 '15 at 15:31
5

On CentOS 6.2 I got it working with the following:

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

khagler
  • 3,996
  • 29
  • 40
4

For those who are using Slackware click here.

I tried it with current and it works.

In short, you need to enable 32bit support by installing multilib packages.

Steps:

1) Download the package:

> wget -np -nH -r -A txz,tgz \
> http://slackware.com/~alien/multilib/14.0/

2) install packages:

~/multilib$ \
> cd \~alien/multilib/14.0/
~/multilib/~alien/multilib/14.0/$ \
> su -c "upgradepkg --reinstall --install-new *.t?z"

3) install compatibility packages:

~/multilib/~alien/multilib/14.0/$ \
> su -c "upgradepkg --reinstall --install-new *-compat32/*/*.t?z"

Restart the system and voila.

Milan Krstic
  • 636
  • 6
  • 11
4

For Ubuntu AMD64: http://blog.jayway.com/2009/10/21/getting-android-sdk-working-on-ubuntu-64/

tommed
  • 1,521
  • 2
  • 19
  • 33
1

For openSUSE you can install the 32bit pattern package

su zypper install -t pattern 32bit

1

On Ubuntu 13.10

sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0

Venky
  • 179
  • 1
  • 4
0

Presumption: Android SDK 32 bit version is installed

On my Ubuntu 12 64 bit OS, I did not have to install any of the packages mentioned in the previous comments. Install the following using Android SDK Manager -
Under Tools:
Android SDK Tools
Android SDK Platform-tools
Latest Android SDK Build-tools

Under the latest Android API (in my case, Android 4.3 (API 18)):
SDK Platform
ARM EABI v7a System Image

Under Extras:
Android Support Library

Warning- I had earlier tried using the ia32-libs package. It installed successfully and I was able to run my Android apps. However, if I restarted the machine, it would never boot. Therefore, I suggest refraining from installing ia32-libs package. If it worked for you then great. Maybe it was an issue restricted to my PC then.

0

A slight twist on the above Q and A: I'm running Debian Wheezy (7.0) on a 64-bit System76 laptop, I had already enabled multiarch and most of the native Android tools seemed to run fine...until I tried building an app. The build failed because one of the resource utilities needed (a 32-bit) libz.so.1.

apt-get install lib32z1

...fixed it for me.

kramer
  • 101
  • 5
0

For AWS Linux, I've found the solution in the old AWS Forum post.

sudo yum install mesa-libGL.i686 libXrender.i686 libSM.i686 freetype.i686 libstdc++.i686

Lee Han Kyeol
  • 2,371
  • 2
  • 29
  • 44
0

For Arch users:
You have to install the lib32-gcc-libs and lib32-ncurses packages which are in the Multilib repository. (Which you have to enable)

pacman -S lib32-gcc-libs  
pacman -S lib32-ncurses
Grrrben
  • 315
  • 3
  • 7
0

You can build sdk yourself. I will try. The 32-bit version is very slow.

imcaptor
  • 360
  • 1
  • 8