使用aapt解析apk信息报错“cannot execute binary file”
2013-08-08 14:20
676 查看
写了个工具类去解析APK包读取里面的信息,在window是环境测试都ok,但是部署到服务器(CentOS)就报错“cannot execute binary file”。
可能的解决方案:
1、如果是没有执行权限,用命令修改即可:chmod +x aapt
2、可能是编译环境不同造成的:请检查是不是因为 32位 64位操作系统导致或者是amd or intel问题导致;
3、如果还报如下错误
“aapt: /lib/libz.so.1: no version information available (required by aapt)”
解决如下:
查了一下,服务器上的libz版本太旧了(libz.so.1.2.3)导致的,下载一个新版本(zlib-1.2.7.tar.gz)即可。
a、tar zxvf zlib-1.2.7.tar.gz
b、./configure
c、make
d、make
install 【确保用root用户,否则会提示Permission denied】
e、链接老版本
: ln -s /usr/local/lib/libz.so.1 /lib/libz.so.1
【可能需要先删除原来的软连接】
4、如果还报如下错误
“error while loading shared libraries: libz.so.1: wrong ELF class: ELFCLASS64...”
换成32位的包,重新安装即可。【如果是64位机器的话,执行 export CFLAGS=-m32 ,然后在按步骤3即可】
5、如果上面的办法都不行:The solution that I found for this issue is
to download the android sdk for linux,install it, and then grab the aapt file from the platform-tools folder and copy it over the aapt file in lib/android/bin.
参考文章:
http://forums.adobe.com/thread/934859
http://hi.baidu.com/whosafe/item/168890359c7fcc3a2f0f8179
http://www.bumao.com/
http://blog.csdn.net/hitlion2008/article/details/7451940#
http://7dot9.com/2012/12/centos-64%E4%BD%8D%E6%9C%BA%E5%99%A8%E9%85%8D%E7%BD%AEandroid-sdk%E5%92%8Cndk%E7%8E%AF%E5%A2%83/
可能的解决方案:
1、如果是没有执行权限,用命令修改即可:chmod +x aapt
2、可能是编译环境不同造成的:请检查是不是因为 32位 64位操作系统导致或者是amd or intel问题导致;
3、如果还报如下错误
“aapt: /lib/libz.so.1: no version information available (required by aapt)”
解决如下:
查了一下,服务器上的libz版本太旧了(libz.so.1.2.3)导致的,下载一个新版本(zlib-1.2.7.tar.gz)即可。
a、tar zxvf zlib-1.2.7.tar.gz
b、./configure
c、make
d、make
install 【确保用root用户,否则会提示Permission denied】
e、链接老版本
: ln -s /usr/local/lib/libz.so.1 /lib/libz.so.1
【可能需要先删除原来的软连接】
4、如果还报如下错误
“error while loading shared libraries: libz.so.1: wrong ELF class: ELFCLASS64...”
换成32位的包,重新安装即可。【如果是64位机器的话,执行 export CFLAGS=-m32 ,然后在按步骤3即可】
5、如果上面的办法都不行:The solution that I found for this issue is
to download the android sdk for linux,install it, and then grab the aapt file from the platform-tools folder and copy it over the aapt file in lib/android/bin.
参考文章:
http://forums.adobe.com/thread/934859
http://hi.baidu.com/whosafe/item/168890359c7fcc3a2f0f8179
http://www.bumao.com/
http://blog.csdn.net/hitlion2008/article/details/7451940#
http://7dot9.com/2012/12/centos-64%E4%BD%8D%E6%9C%BA%E5%99%A8%E9%85%8D%E7%BD%AEandroid-sdk%E5%92%8Cndk%E7%8E%AF%E5%A2%83/
相关文章推荐
- Java解析APK信息,使用ApkFile
- gcc不要使用-c参数,否则报-bash: ./mk_dia_ding3: cannot execute binary file
- 使用NDK编译时出现cannot execute binary file的问题
- 使用adb aapt获取手机上apk的信息
- 执行shell脚本报错 cannot execute binary file
- linux系统中安装jdk出现bash: ./java: cannot execute binary file 问题
- Java: cannot execute binary file
- JMS之—— ActiveMQ中使用mysql做持久化报错:Cannot execute statement: impossible to write to binary log since BINL
- cannot execute binary file 安装jdk问题
- gcc ——“cannot execute binary file”
- 转载分析apk工具aapt的使用,解析其原理
- mongodb错误解决办法-bash: ./mongod: cannot execute binary file: Exec format error
- ActiveMQ中使用mysql做持久化报错:Cannot execute statement: impossible to write to binary log since BINLOG_FORM
- cannot execute binary file
- cygwin:as.exe: cannot execute binary file
- linux出现bash: ./java: cannot execute binary file 问题的解决办法
- 请教 cannot execute binary file问题
- thinkphp使用aapt获取apk信息
- java使用android aapt获取APK信息
- android Ubuntu adb: cannot execute binary file: 可执行文件格式错误