您的位置:首页 > 移动开发 > Android开发

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

2015-03-06 11:00 218 查看
在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。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: