Execute failed: java.io.IOException: Cannot run program "sdk-linux/build-tools/22.0.0/aapt": error=2
在Linux上使用ant编译打包apk的时候,出现以下的错误及解决方法:
1、/usr/local/android-sdk-linux/tools/ant/build.xml:698: Execute failed: java.io.IOException: Cannot run program "/usr/local/android-sdk-linux/build-tools/22.0.0/aapt": error=2, No such file or directory
BUILD FAILED
/svcroot/workspace/build/MobileAppAndorid/build.xml:94: The following error occurred while executing this line:
/usr/local/android-sdk-linux/tools/ant/build.xml:653: The following error occurred while executing this line:
/usr/local/android-sdk-linux/tools/ant/build.xml:698: Execute failed: java.io.IOException: Cannot run program "/usr/local/android-sdk-linux/build-tools/22.0.0/aapt": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041)
at java.lang.Runtime.exec(Runtime.java:617)
at org.apache.tools.ant.taskdefs.launcher.Java13CommandLauncher.exec(Java13CommandLauncher.java:58)
at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:428)
at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:442)
at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:628)
at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:669)
at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:495)
at com.android.ant.AaptExecTask.execute(AaptExecTask.java:699)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at com.android.ant.IfElseTask.execute(IfElseTask.java:120)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:396)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:441)
at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.Main.runBuild(Main.java:851)
at org.apache.tools.ant.Main.startAnt(Main.java:235)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:135)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022)
... 59 more原因:在64位Linux下打包成APK时缺少x86下C++语言库。
解决:
# yum install -y compat-libstdc++-296.i686
# yum install -y compat-libstdc++-33.i686
2、/usr/local/android-sdk-linux/build-tools/20.0.0/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
-code-gen:
[mergemanifest] Found modified input file
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Generating resource IDs...
[aapt] /usr/local/android-sdk-linux/build-tools/20.0.0/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory BUILD FAILED
/svcroot/workspace/build-app/MobileAppAndorid/build.xml:94: The following error occurred while executing this line:
/usr/local/android-sdk-linux/tools/ant/build.xml:653: The following error occurred while executing this line:
/usr/local/android-sdk-linux/tools/ant/build.xml:698: null returned: 127
解决:
# yum install -y zlib
(yum配置能够參考帖子 http://blog.csdn.net/catoop/article/details/41345471 我用的是RHEL 6.5版本号的Linux)
3、[aapt] /android/sdk/build-tools/android-4.4/aapt: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
-code-gen:
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Generating resource IDs...
[aapt] /android/sdk/build-tools/android-4.4/aapt: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory原因:在64位Linux下打包成APK时缺少x86下C++语言库。
解决:
# yum install -y libstdc++.so.6
假设2、3的问题还没有解决,使用以下的命令试试:
# yum install glibc*.i686
# yum install zlib*.i686
# yum install libstdc++.so.6
假设在运行 yum install libstdc++.so.6 的时候出现例如以下错误:
Error: Multilib version problems found. This often means that the root
cause is something else and multilib version checking is just
pointing out that there is a problem. Eg.: 1. You have an upgrade for libstdc++ which is missing some
dependency that another package requires. Yum is trying to
solve this by installing an older version of libstdc++ of the
different architecture. If you exclude the bad architecture
yum will tell you what the root cause is (which package
requires what). You can try redoing the upgrade with
--exclude libstdc++.otherarch ... this should give you an error
message showing the root cause of the problem. 2. You have multiple architectures of libstdc++ installed, but
yum can only see an upgrade for one of those arcitectures.
If you don't want/need both architectures anymore then you
can remove the one with the missing update and everything
will work. 3. You have duplicate versions of libstdc++ installed already.
You can use "yum check" to get yum show these errors. ...you can also use --setopt=protected_multilib=false to remove
this checking, however this is almost never the correct thing to
do as something else is very likely to go wrong (often causing
much more problems). Protected multilib versions: libstdc++-4.4.7-11.el6.i686 != libstdc++-4.4.7-4.el6.x86_64解决的方法:yum update libstdc++-4.4.7-4.el6.x86_64
然后再运行:yum install libstdc++.so.6
---------------
(完)
Execute failed: java.io.IOException: Cannot run program "sdk-linux/build-tools/22.0.0/aapt": error=2的更多相关文章
- hudson运行出现java.io.IOException Cannot run program的错误分析
作者:朱金灿 来源:http://blog.csdn.net/clever101 在昨天运行每日构建时hudson突然出错,错误信息如下: [MySoft3.1] $ cmd /c call &quo ...
- Jenkins报错Caused: java.io.IOException: Cannot run program "sh" (in directory "D:\Jenkins\Jenkins_home\workspace\jmeter_test"): CreateProcess error=2, 系统找不到指定的文件。
想在本地执行我的python文件,我本地搭建了一个Jenkins,使用了execute shell来运行我的脚本,发现报错 [jmeter_test] $ sh -xe D:\tomcat\apach ...
- java.io.IOException: Cannot run program "/opt/jdk1.8.0_191/bin/java" (in directory "/var/lib/jenkins/workspace/xinguan"): error=2, No such file or directory
测试jenkins构建,报错如下 Parsing POMs Established TCP socket on 44463 [xinguan] $ /opt/jdk1.8.0_191/bin/java ...
- 解决java.io.IOException: Cannot run program "cygpath": CreateProcess error=2, 系统找不到指定的文件 的错误
一.外部环境: 系统环境:Windows 8 磁盘分区:只有C盘 开发环境:IntelliJ IDEA Community Edition 2016.1.3(64) 执行代码:rdd.saveAsTe ...
- java.io.IOException: Cannot run program "jad"
今天调试google tag manager, 需要看看google analytics source code,无奈没有源码,装个一个插件ejad 还是不行: java.io.IOException ...
- java.io.IOException: Cannot run program "bash": error=12, Cannot allocate memory
java.io.IOException: Cannot run program , Cannot allocate memory 云服务器运行nutch报出的异常: 解决方案: http://daim ...
- 解决方案--java执行cmd命令ProcessBuilder--出错Exception in thread "main" java.io.IOException: Cannot run program "dir d:\": CreateProcess error=2(xjl456852原创)
当我尝试在java中通过ProcessBuilder运行window的cmd命令时出现错误: public static void main(String [] args) throws IOExce ...
- linux下java.io.IOException: Cannot run program "/opt/jdk/jre/bin/java": error=13, Permission denied
linux下启动jetty时报: [root@mv01 jetty-distribution-9.2.14.v20151106]# java -jar start.jar java.io.IOExce ...
- Jmeter常见报错信息: ERROR - jmeter.protocol.http.proxy.ProxyControl: Could not initialise key store java.io.IOException: Cannot run program "keytool"
JMeter 2.10 用的新方法来录制HTTPS请求Java 7. 录制的过程中会碰到一些问题或者报错,就目前碰到的,做出一些总结. ERROR - jmeter.protocol.http.pro ...
随机推荐
- MySQL注射绕过技巧(三)
在测试一次注入的时候发现过滤了逗号 所以找到这个思路 第一次遇到的时候是看key哥挖洞 遇到后就想记录下来 正文 过滤了逗号 利用join来逐步查询 select*from(select 1)a ...
- hdu 3294 manacher 求回文串
感谢: http://blog.csdn.net/ggggiqnypgjg/article/details/6645824/ O(n)求给定字符串的以每个位置为中心的回文串长度. 中心思想:每次计算位 ...
- Uva1553 Caves and Tunnels LCT
简单题,主要为了练手. #include <cstdio> #include <iostream> #define maxn 100010 using namespace st ...
- PAT甲级1033. To Fill or Not to Fill
PAT甲级1033. To Fill or Not to Fill 题意: 有了高速公路,从杭州到任何其他城市开车很容易.但由于一辆汽车的坦克容量有限,我们不得不在不时地找到加油站.不同的加油站可能会 ...
- hihocoder1489 Legendary Items (微软2017年预科生计划在线编程笔试)
http://hihocoder.com/problemset/problem/1489 笔试题第一道,虽然说第一道都很水,但是我感觉这题不算特别水把..这道题我就卡住了我记得,tle,最后只有30分 ...
- 配置nginx虚拟目录配置文件支持tp的pathinfo
lnmp自带的包不好用, 经测试,在相应的conf文件加入这句话即可: location / { if (!-e $request_filename) { rewrite ^(.*)$ /index. ...
- unix-软件安装
检查软件是否已经安装 rpm -qa|grep 软件标识名 在线安装软件 yum -y install 软件标识名
- asp.net 链接数据库ADO.NET
web.config <configuration> <connectionStrings> <add name="constr" connectio ...
- <摘录>Gson对Java嵌套对象和JSON字符串之间的转换
JSON(JavaScript Object Notation) 是一种轻量级的数据交换格式,具有良好的跨平台特性.近几年来已经和XML一样成为C/S架构中广泛采用的数据格式.有关JSON的更多知识, ...
- 使用本地的Nuget Repository加速Nuget访问速度
Nuget是一个在VisualStudio下的非常好用的包管理器,然而由于众所周知的原因,其访问速度非常令人抓狂,甚至抽风.在没有VPN的环境下,如何解决这一问题呢?常见的解决方案是自己搭建一个Nug ...