mythicalprogrammer
mythicalprogrammer

Reputation: 4757

Ubuntu 64 with Android 64 Bundle cannot find adb executable

I'm experiencing the following problem when trying to run adb on Ubuntu 12.10, x86_64:

[2013-02-19 20:56:04 - adb] Unexpected exception 'Cannot run program 
"/home/user/adt-bundle-linux-x86_64/sdk/platform-tools/adb": error=2, 
No such file or directory' while attempting to get adb version from 
'/home/user/adt-bundle-linux-x86_64/sdk/platform-tools/adb'

I located adb, tried chmod +x adb and it just doesn't work. I also tried chmod +x platform-tools/ and chmod +x tools/. After that I tried ./adb

I've Googgled for the problem. They were talking about ia32 package. Ubuntu can't locate that package nor the ia32 multi arch whatever.

System is Ubuntu 12.10 64 and I downloaded adt-bundle-linux-x86_64.zip package and just unzip it.

What am I doing wrong ? Thank you!

Upvotes: 13

Views: 26083

Answers (5)

amo-ej1
amo-ej1

Reputation: 3307

On Debian 7 I bumped in the same issue.

Diagnosis:

edb@lapelidb:~/today$ ldd /opt/adt-bundle-linux-x86_64-20130729/sdk/platform-tools/adb
    not a dynamic executable
edb@lapelidb:~/today$ file  /opt/adt-bundle-linux-x86_64-20130729/sdk/platform-tools/adb
/opt/adt-bundle-linux-x86_64-20130729/sdk/platform-tools/adb: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.8, not stripped

Solution: Adding support for 32-bit support and the required 32-bit libraries:

edb@lapelidb:~/today$ sudo dpkg --add-architecture i386
edb@lapelidb:~/today$ sudo apt-get update 
edb@lapelidb:~/today$ sudo apt-get install libc6:i386 libstdc++6:i386

Et voila:

edb@lapelidb:~/today$ ldd /opt/adt-bundle-linux-x86_64-20130729/sdk/platform-tools/adb
    linux-gate.so.1 =>  (0xf772a000)
    librt.so.1 => /lib/i386-linux-gnu/i686/cmov/librt.so.1 (0xf770a000)
    libdl.so.2 => /lib/i386-linux-gnu/i686/cmov/libdl.so.2 (0xf7706000)
    libpthread.so.0 => /lib/i386-linux-gnu/i686/cmov/libpthread.so.0 (0xf76ec000)
    libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xf7600000)
    libm.so.6 => /lib/i386-linux-gnu/i686/cmov/libm.so.6 (0xf75da000)
    libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xf75bd000)
    libc.so.6 => /lib/i386-linux-gnu/i686/cmov/libc.so.6 (0xf745a000)
    /lib/ld-linux.so.2 (0xf772b000)

Upvotes: 19

Eagle
Eagle

Reputation: 1

I use debian_x64

add i386 lib

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

ldd /home/yourname/adt-bundle-linux-x86_64-20130729/sdk/platform-tools/adb

when you found “android-sdks/build-tools/17.0.0/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory”

you can try sudo apt-get install ia32-libs sudou apt-get install zlib.i686

restart your computer and try again

Upvotes: 0

Rocky Inde
Rocky Inde

Reputation: 1531

I'm using Ubuntu 12.04 LTS version. I've tried the steps suggested by 'amo-ej1', but my 'dpkg' didn't have 'add' or 'architecture' options.

However, the following worked for me:

1) Install 'adb' and 'fastboot' provided by the following third-party PPA.

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install android-tools-adb android-tools-fastboot

2) Replace the copy of 'adb' and 'fastboot' provided by the official Android SDK with those installed from the above step:

cp /usr/bin/adb <path-to-your-adt-sdk-package>/sdk/platform-tools/adb
cp /usr/bin/fastboot <path-to-your-adt-sdk-package>/sdk/platform-tools/fastboot

3) Restart(re-execute) your eclipse binary.

Full credits: http://www.webupd8.org/2012/08/install-adb-and-fastboot-android-tools.html

IMPORTANT EDIT (ALTERNATE SOLUTION):

Although the above would resolve your error (and you can proceed with the Android App tutorial), as I found, ADT will also need 'aapt' (another 32-bit binary) located in:

 <path-to-your-adt-sdk-package>/sdk/build-tools/android-x.x/

And unfortunately, the link that I provided above doesn't provide this binary.

So, here's my other solution:

1) Update your system

Open 'Update Manager' => 'Settings' => 'Updates
Check "Recommended Updates (precise updates)"
Update the updates that are being shown

2) Install ia32-libs

sudo apt-get install ia32-libs

And I finally was able to install 'ia32-libs'. To know why 'ia32-libs' wouldn't install in the first place, please read the answer posted by 'slangasek' here: https://askubuntu.com/questions/136394/cannot-install-ia32-libs

Upvotes: 9

mythicalprogrammer
mythicalprogrammer

Reputation: 4757

On Ubuntu 12.10 x86_64 the package to run 32bits are ia32-libs and ia32-libs-multiarch.

If you type

file adb

You'll see that adb is a 32 bit file on a 64 bit system. You need the ia32 packages to emulate and run this file. But you can't!

The problem right now is you cannot download these packages, they're trying to convert it to something I guess x86_64. Here you can read about convert in the package NEWS:

summary of the conversion:

"ia32-libs (20090808ubuntu27) precise; urgency=low

  • ia32-libs is now a transitional package depending on ia32-libs-multiarch, the i386-only package which depends on all the 32-bit library packages previously included in ia32-libs itself. As a result, ia32-libs will be uninstallable for some time during the precise cycle, while the dependent libraries are updated to be coinstallable using multiarch. Developers are encouraged to help with the conversion process for these libraries, described at:

    http://wiki.debian.org/Multiarch/Implementation

    -- Steve Langasek "

So if you try to edit your source.list file to grab it from older repo you'll break packages. So ubuntu 12.10 people have to wait or adb is compile or whatever to 64 bit.

edit:

Debian 7.0 will support multiarch where x64 version can run x32 binary. source: http://www.debian.org/News/2013/20130504

Upvotes: 5

bmavus
bmavus

Reputation: 892

unzip that file with this:

sudo tar xvfz adt-bundle-linux-x86.zip -C /opt/android

than run that code:

sudo chown -R your_user_name /opt/android

i think it will work

Upvotes: -1

Related Questions