Ubuntu下Android SDK中adbs问题的解决方案

在Linux平台下配置Android SDK开发环境过程中,Eclipse会提示错误如下:


Unexpected exception 'Cannot run program "/home/ubuntu/adt/sdk/platform-tools/adb":error=2 No such file or directory' while attempting to get adb version from /home/ubuntu/adt/sdk/platform-tools/adb

遇到上述问题出现的原因是:
在64bit的系统环境下,Android sdk只有32bit的程序,需要安装ia32-libs兼容库,才能正常使用。

通常的建议是运行以下命令:

sudo apt-get install ia32-libs

但是一般情况下会出现以下错误:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package ia32-libs 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
However the following packages replace it:
  lib32z1 lib32ncurses5 lib32bz2-1.0

E: Package 'ia32-libs' has no installation candidate

根据上面的提示运行以下命令:

sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0

再次打开eclipse上述问题就会消失。但接着又出现一个新的问题,大致如下:

./emulator: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

问题原因同上,缺少 lib32stdc++6这个包,使用 apt-get install 命令安装一下就应该可以了。

麻烦接踵而至,因为缺少gcc的依赖包,这简直是个掉进坑里了。可以一步一步按照提示安装各种依赖包,知道问题解决。这里提供一个快速的解决方案:

按照http://jingyan.baidu.com/article/851fbc37fe45773e1f15abe0.html中的方法将ubuntu中软件更新源改为http://ftp.sjtu.edu.cn/ubuntu,这是上海交大的一个映像地址。然后在设置中心对系统进行更新。再次运行 sudo apt-get install lib32stdc++6 即可。

到这里eclipse中新建的android程序就可以正常运行,好艰难的hello android。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值