Bash cannot find adb even though it's definitely there - android

I'm running ArchLinux, kernel 3.4.4, bash version 4.2.29. I downloaded the android sdk from here: http://developer.android.com/sdk/index.html
Once extracted I did, did ~/android-sdk-linux/tools/android and installed the SDK platform tools package.
From there I tried the following:
> ls -l ~/android-sdk-linux/platform-tools/adb
-rwxr-xr-x 1 mediocregopher mediocregopher 204436 Jun 28 13:20 /home/mediocregopher/android-sdk-linux/platform-tools/adb
> file ~/android-sdk-linux/platform-tools/adb
/home/mediocregopher/android-sdk-linux/platform-tools/adb: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.8, stripped
> ~/android-sdk-linux/platform-tools/adb
bash: /home/mediocregopher/android-sdk-linux/platform-tools/adb: No such file or directory
Clearly the file is there and at the very least executable, why can't bash seem to find it? I've tried adding the platform-tools folder to my path as well as sudo and su-ing, but no matter what it seems like the file is not found. Does anyone know what could be happening?

You're running on a 64bit system and you do not have the 32bit compatibility libraries installed.
The error is actually coming from the fact that it can't find the 32bit ld.so.
If you're using ubuntu/debian, I think you just need to sudo apt-get install ia32-libs and it should work.

For 'modern' versions of Ubuntu (13.10 and higher), the accepted answer is not working anymore: They removed the '32 bit compability libraries' and instead you need to use multiarch packages that happily coexists next to each other. See What happened to the ia32-libs package? on AskUbuntu.
Instead you need to install the 32 bit version of libc:
sudo apt-get install libc6:i386
Next, I encounterd that a 32 bit version of libstdc++ is also required by adb:
sudo apt-get install libstdc++6:i386
Now adb should be working (again).
Android SDK on a 64-bit linux machine shows that some other libraries are required as well. I did not seem to require them as well, but might have had them installed already.

Related

Exception in thread "png-cruncher_x" [duplicate]

I've installed Android Studio 1.2, and created a new project. When I attempt to build, it hangs. This is in the Gradle Console, along with about 20 other copies, with different numbers after png-cruncher_:
Exception in thread "png-cruncher_2" java.lang.RuntimeException: Timed out while waiting for slave aapt process, try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 5 seconds
at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:104)
at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:107)
at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:204)
at java.lang.Thread.run(Thread.java:745)
I had the same problem with Debian Jessie for AMD64. I did this, and it works:
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386
I had the same issue whilst running Android Studio 1.5.1 for Windows 8.1 (64 bit), and what I did to solve the problem was by adding the following two system environment variables:
SLAVE_AAPT_TIMEOUT = 30
JAVA_HOME = C:\Program Files\Java\jdk1.8.0_65
(Please note: The path for the JAVA_HOME system environment variable is dependant on where your JDK is located and that the version of your JDK may differ from the example above).
I had this problem on Windows 8.1 64 bits and what ended up solving everything was running gradle in the command line in debug mode, on the project folder:
gradlew -d assembleDebug
Running without the -d flag had the same problem.
After running the first time, everything was ok, I could even clean and rebuild my project.
I had this problem and what was missing were a library to be installed on the SDK.
Just installing the correct library immediately solved the problem.
In my case was the Android Support Library, as I was creating a navigation drawer.
The errors shown in the gradle console didn't give me a clue for the solution, and didn't helped me at all.
Click on SDK manager, and click on the tab SDK Tools, check "Android Support Library" and click apply.
This is a known bug reported here --> https://code.google.com/p/android/issues/detail?id=188627
The workaround on Mac is to reboot your computer.
If you are running on a Linux x64 machine you probably miss some required libraries. The offical sdk guide states:
Required libraries for 64-bit machines:
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
of course don't forget to
sudo apt-get update
first.
By pausing the antivirus I don't have anymore that problem, or better by making a rule at the antivirus in order to accept a given '.class' filename recognized as trojan, then banned at compile-time.
Check your firewall if it is coming in your way. Disabling my firewall works for me but i don't know if it's the right fix.
I had the same problem with CentOS 6.5. Before this error, I found the cause of the error, as follows.
AAPT err(Facade for 1129807373): xxx/aapt: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by xxx/lib64/libc++.so)
“libc.so.6: version `GLIBC_2.14' not found” . The highest version of CentOS 6.5 is 2.12, and we need to upgrade to 2.14.
Display the installed glibc version:
# rpm -qa | grep glibc
To download the corresponding RPM package. -> ftp.redsleeve.org/pub/steam/
Install the RPM package as follows:
# rpm -Uvh glibc-2.15-60.el6.x86_64.rpm glibc-common-2.15-60.el6.x86_64.rpm glibc-devel-2.15-60.el6.x86_64.rpm glibc-headers-2.15-60.el6.x86_64.rpm --nodeps --force
I uninstalled 1.2 and installed 1.1, but it did't work.
Because I used local SDK installed previously, I uninstalled and reinstalled 1.1 and installed SDK to new path.
After I used SDK in new path, I don't have those errors any more.
And I upgraded Android Studio to 1.2, and also I don't have errors.
Downgrading Build Tools rescued me.

Android Studio fails to build new project, timed out while wating for slave aapt process

I've installed Android Studio 1.2, and created a new project. When I attempt to build, it hangs. This is in the Gradle Console, along with about 20 other copies, with different numbers after png-cruncher_:
Exception in thread "png-cruncher_2" java.lang.RuntimeException: Timed out while waiting for slave aapt process, try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 5 seconds
at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:104)
at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:107)
at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:204)
at java.lang.Thread.run(Thread.java:745)
I had the same problem with Debian Jessie for AMD64. I did this, and it works:
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386
I had the same issue whilst running Android Studio 1.5.1 for Windows 8.1 (64 bit), and what I did to solve the problem was by adding the following two system environment variables:
SLAVE_AAPT_TIMEOUT = 30
JAVA_HOME = C:\Program Files\Java\jdk1.8.0_65
(Please note: The path for the JAVA_HOME system environment variable is dependant on where your JDK is located and that the version of your JDK may differ from the example above).
I had this problem on Windows 8.1 64 bits and what ended up solving everything was running gradle in the command line in debug mode, on the project folder:
gradlew -d assembleDebug
Running without the -d flag had the same problem.
After running the first time, everything was ok, I could even clean and rebuild my project.
I had this problem and what was missing were a library to be installed on the SDK.
Just installing the correct library immediately solved the problem.
In my case was the Android Support Library, as I was creating a navigation drawer.
The errors shown in the gradle console didn't give me a clue for the solution, and didn't helped me at all.
Click on SDK manager, and click on the tab SDK Tools, check "Android Support Library" and click apply.
This is a known bug reported here --> https://code.google.com/p/android/issues/detail?id=188627
The workaround on Mac is to reboot your computer.
If you are running on a Linux x64 machine you probably miss some required libraries. The offical sdk guide states:
Required libraries for 64-bit machines:
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
of course don't forget to
sudo apt-get update
first.
By pausing the antivirus I don't have anymore that problem, or better by making a rule at the antivirus in order to accept a given '.class' filename recognized as trojan, then banned at compile-time.
Check your firewall if it is coming in your way. Disabling my firewall works for me but i don't know if it's the right fix.
I had the same problem with CentOS 6.5. Before this error, I found the cause of the error, as follows.
AAPT err(Facade for 1129807373): xxx/aapt: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by xxx/lib64/libc++.so)
“libc.so.6: version `GLIBC_2.14' not found” . The highest version of CentOS 6.5 is 2.12, and we need to upgrade to 2.14.
Display the installed glibc version:
# rpm -qa | grep glibc
To download the corresponding RPM package. -> ftp.redsleeve.org/pub/steam/
Install the RPM package as follows:
# rpm -Uvh glibc-2.15-60.el6.x86_64.rpm glibc-common-2.15-60.el6.x86_64.rpm glibc-devel-2.15-60.el6.x86_64.rpm glibc-headers-2.15-60.el6.x86_64.rpm --nodeps --force
I uninstalled 1.2 and installed 1.1, but it did't work.
Because I used local SDK installed previously, I uninstalled and reinstalled 1.1 and installed SDK to new path.
After I used SDK in new path, I don't have those errors any more.
And I upgraded Android Studio to 1.2, and also I don't have errors.
Downgrading Build Tools rescued me.

64-bit version of adb and fastboot?

I'm catching the error below on Debian 7.3, x64 (fully patched).
I'm pretty certain its because adb is 32-bit even in the 64-bit distro of its SDK tools
$ which adb
/opt/android-sdk/platform-tools/adb
$ /opt/android-sdk/platform-tools/adb
bash: /opt/android-sdk/platform-tools/adb: No such file or directory
$ file /opt/android-sdk/platform-tools/adb
/opt/android-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
I don't want to install hundreds of megabytes of 32-bit binaries just to support adb and fastboot. (See, for example, Ubuntu 64 with Android 64 Bundle cannot find adb executable).
I know there's an outstanding feature request from 2012 at Please port SDK tools to 64-bit on Linux (adb, aapt, etc), but no action has been taken (even no acknowledgement).
Does anyone know if Google makes a 64-bit version of adb? If not, does Google have any plans on providing them?
Good news. it is now officialy maintained by the fine folks at Debian.
just install android-tools-adb (you also have fastboot and a few others) from the main debian repo (no need to add repo as this is there by default)
it is native amd64 architecture!
$ sudo aptitude install android-tools-adb
...
$ file /usr/bin/adb
/usr/bin/adb: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=b36a05975f3d903a4f0ee3e02b581cc71ddedf26, stripped
Nobody comes here looking for answers to this question anymore since the packages distributed with Android SDK come in 64-bit flavor by default now.
So I am just writing down version numbers for the last 32-bit packages for future reference:
build-tools_r23.0.3
platform-tools_r23.0.1
If you are running debian/ubuntu 12.04 follow this guide to add the ppa for the 64bit fastboot and adb
http://bernaerts.dyndns.org/linux/74-ubuntu/245-ubuntu-precise-install-android-sdk
If you do not need the SDK and just need the android-tools, do
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install android-tools-adb android-tools-fastboot
If you want the SDK API on your precise 64 bit, then sorry, you have to install ia32-libs.
Newer than 12.04 (12.10 and above) I think android-tools-adb and android-tools-fastboot 64bit are in the universe respository. No additional PPA necessary.
David
Instead of use a repository, and if you prefer to work with your downloaded Android SDK, you should use this procedure that is decribed here.
To resume:
Install the Android SDK
Add the i386 MultiArch support to your Debian:
sudo dpkg --add-architecture i386
Update your package list
sudo apt-get update
And install the following i386 packages
sudo aptitude install libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386
Now, all the Android SDK platform tools should work.
Edit (2014/06/06): The solution has been already answered on this Stackoverflow post.

Cannot run program " xx/sdk//tools/emulator": java.io.IOException: error=2, No such file or directory

I have installed android SDK and android eclipse plugin successfully on Ubuntu 12.10.
I created the AVD in eclipse, and now it's not running. This is the output error I receive when I run the AVD:it tips:
Starting emulator for AVD 'avd'
Failed to start emulator: Cannot run program "/home/sancai/android/adt-bundle-linux-x86_64-20130522/sdk//tools/emulator": java.io.IOException: error=2, No such file or directory
I find information via google, everyone says this is because my system version is 64, while the adt only support 32, to install: sudo apt-get install ia32-libs, when I installed the 32-bit library, other problems arise such as the library file association to other libraries, but has no other library files are fully,it tips:
sancai#ubuntu:~$ sudo apt-get install ia32-libs
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
ia32-libs : Depends: ia32-libs-multiarch but it is not installable
E: Unable to correct problems, you have held broken packages.
sancai#ubuntu:~$ sudo apt-get install ia32-libs-multiarch
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package ia32-libs-multiarch is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'ia32-libs-multiarch' has no installation candidate
This should help:
Go to xx/sdk/tools and run:
mv emulator emulator.bak
ln -s emulator64-arm emulator
No need to install any ia32 libs.
This is the answer http://astroelec.blogspot.com/
(using Debian)
Installing ia32-libs will no longer work as debian has moved to multiarch support.
Solution. Use Multiarch
Multiarch support makes installing libraries from the i386 distribution easy...
sudo dpkg --add-architecture i386
sudo aptitude update
sudo aptitude install libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386
Now launch eclipse, and everything should now work just fine.
In my configuration, I have set up the virtual devices to use Intel Atom system image. Lawrence Angrave from the University Illinois said in his Coursera androidapps101 course that it will run faster than the ARM image. So this works for me:
mv emulator emulator_bak
ln -s emulator64-x86 emulator
You do not need install packages any more!
In directory tools, there are many types of emulator, while my computer works with emulator64-arm! My system is Linux Mint 16 amd64! Good luck!
./emulator64-arm #yxphone -sdcard yxsd -scale 0.8
it's easy,this is my solutions.
copy and paste, this lines in your terminal.
apt-get install libncurses5:i386 \
libstdc++6:i386 \
zlib1g:i386
good luck!!
This might help
sudo aptitude install ia32-libs lib32ncurses5 lib32stdc++6

Eclipse on x64 Fedora

I have installed eclipse and android SDK on Fedora 17. In eclipse I got this error
/home/jakub/Android/android-sdk-linux/platform-tools/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
I tried install this packages: ncurses-libs.i686 libstdc++.i686 libgcc.i686, but always got that error
i got it working on 64bit CentOS using a stackexchange answer i cannot find at the moment. It basically involved appending .i686 to several package names, ie:
yum install libstdc++.i686
ia32-libs does not formally exist as an rpm. However, on my Ubuntu 10.04 box
dpkg --listfiles ia32-libs | wc
indicates there are 1456 files in ia32-libs to make 32bit stuff work on 64bit Debian based platforms. i certainly did not install 1456 .i686 packages. So just now, i entered
$ rpm -qa | grep i686
libX11-1.3-2.el6.i686
libstdc++-4.4.6-4.el6.i686
openssl-1.0.0-25.el6_3.1.i686
libXau-1.0.5-1.el6.i686
SDL-1.2.14-3.el6.i686
glibc-2.12-1.80.el6_3.7.i686
libgcc-4.4.6-4.el6.i686
libxcb-1.5-1.el6.i686
libXrandr-1.3.0-4.el6.i686
zlib-1.2.3-27.el6.i686
libselinux-2.0.94-5.3.el6.i686
openssl-devel-1.0.0-25.el6_3.1.i686
nss-softokn-freebl-3.12.9-11.el6.i686
ncurses-libs-5.7-3.20090208.el6.i686
krb5-libs-1.9-33.el6_3.3.i686
libXext-1.1-3.el6.i686
libcom_err-1.41.12-12.el6.i686
libXrender-0.9.5-1.el6.i686
keyutils-libs-1.4-4.el6.i686
When i find the original answer i used, i will post it back here.
did you used android in fedora before.?
System requirements
Operating Systems
Windows XP (32-bit), Vista (32- or 64-bit), or Windows 7 (32- or 64-bit)
Mac OS X 10.5.8 or later (x86 only)
Linux (tested on Ubuntu Linux, Lucid Lynx)
GNU C Library (glibc) 2.7 or later is required.
On Ubuntu Linux, version 8.04 or later is required.
64-bit distributions must be capable of running 32-bit applications.
link:
because SDK is 32bit
try to use: yum install ia32-libs

Categories

Resources