解決安裝platform-tools故障

一、解壓軟件包

[root@webLogic-15 script]# ll
總用量 9260
-rw-r--r--. 1 root root 9479625 12月  4 14:54 platform-tools_r08-linux.zip
[root@webLogic-15 script]# unzip platform-tools_r08-linux.zip
Archive:  platform-tools_r08-linux.zip
  inflating: platform-tools/NOTICE.txt
  inflating: platform-tools/aapt   
  inflating: platform-tools/adb    
  inflating: platform-tools/aidl   
  inflating: platform-tools/dexdump
  inflating: platform-tools/dx     
   creating: platform-tools/lib/
  inflating: platform-tools/lib/dx.jar
  inflating: platform-tools/llvm-rs-cc
 extracting: platform-tools/source.properties
[root@webLogic-15 script]# ll
總用量 9264
drwxr-xr-x. 3 root root    4096 12月  4 14:54 platform-tools
-rw-r--r--. 1 root root 9479625 12月  4 14:54 platform-tools_r08-linux.zip
[root@webLogic-15 script]# cd platform-tools
[root@webLogic-15 platform-tools]# ll
總用量 19472
-rwxrwxrwx. 1 root root   807252 10月 13 2011 aapt
-rwxrwxrwx. 1 root root   159620 10月 13 2011 adb
-rwxrwxrwx. 1 root root   164312 10月 13 2011 aidl
-rwxrwxrwx. 1 root root   368717 10月 13 2011 dexdump
-rwxrwxr-x. 1 root root     2603 10月 13 2011 dx
drwxrwx---. 2 root root     4096 10月 13 2011 lib
-rwxrwxrwx. 1 root root 18043680 10月 13 2011 llvm-rs-cc
-rw-rw----. 1 root root   366627 10月 13 2011 NOTICE.txt
-rw-rw-rw-. 1 root root       32 10月 13 2011 source.properties


二、執行aapt命令,報如下錯誤:

[root@webLogic-15 platform-tools]# ./aapt
./aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory

解決該錯誤方法:

[root@webLogic-15 platform-tools]# yum install zlib-1.2.3-29.el6.i686 --setopt=protected_multilib=false


三、再次執行aapt命令,還是報錯

[root@webLogic-15 platform-tools]# ./aapt --help
./aapt: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

查看哪個安裝包包含該庫文件:

[root@webLogic-15 platform-tools]#yum whatprovides libstdc++.so.6
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.163.com
 * extras: mirrors.163.com
 * updates: mirrors.163.com
libstdc++-4.4.7-4.el6.i686 : GNU Standard C++ Library
Repo        : base
Matched from:
Other       : libstdc++.so.6


安裝libstdc++-4.4.7-4.el6.i686包

[root@webLogic-15 platform-tools]# yum -y install libstdc++-4.4.7-4.el6.i686
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.163.com
 * extras: mirrors.163.com
 * updates: mirrors.163.com
...
...
Error: Protected multilib versions: libstdc++-4.4.7-4.el6.i686 != libstdc++-4.4.6-4.el6.x86_64
 You could try using --skip-broken to work around the problem
** Found 1 pre-existing rpmdb problem(s), 'yum check' output follows:
zlib-1.2.3-29.el6.i686 is a duplicate with zlib-1.2.3-27.el6.x86_64

執行以下命令,解決庫衝突問題:

[root@webLogic-15 platform-tools]# yum -y install libstdc++-4.4.7-4.el6.i686 --setopt=protected_multilib=false
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.163.com
 * extras: mirrors.163.com
 * updates: mirrors.163.com
Setting up Install Process
....
....
Installed:
  libstdc++.i686 0:4.4.7-4.el6                                                                                                    
Dependency Installed:
  libgcc.i686 0:4.4.7-4.el6                                                                                                       
Dependency Updated:
  libgcc.x86_64 0:4.4.7-4.el6                                                                                                     
Complete!


四、再次執行aapt命令,查看問題是否解決

[root@webLogic-15 platform-tools]# ./aapt --help
ERROR: Unknown command '--help'
Android Asset Packaging Tool
Usage:
 aapt l[ist] [-v] [-a] file.{zip,jar,apk}
   List contents of Zip-compatible archive.
 aapt d[ump] [--values] WHAT file.{apk} [asset [asset ...]]
   badging          Print the label and icon for the app declared in APK.
   permissions      Print the permissions from the APK.
   resources        Print the resource table from the APK.
   configurations   Print the configurations in the APK.
   xmltree          Print the compiled xmls in the given assets.
   xmlstrings       Print the strings of the given compiled xml assets.
。。。
。。。

至此,問題得到解決!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章