Ionic Build Android在Mac OS X 10.10 Yosemite上失败

时间:2014-11-27 23:15:41

标签: android apache cordova ant ionic-framework

Ionic / Corodva使用iOS平台在我的Mac OS X 10.10上运行文件,但是它可以构建android,我怎么能成功添加平台android。 android api 19安装

我的.bash_profile:

  

导出ANT_HOME = / Users / ayman / ant

     

出口   PATH = $ PATH:在/ usr / local / bin中:/用户/艾曼/ ADT / SDK /平台的工具:$ ANT_HOME / bin中:/用户/艾曼/ ADT / SDK /工具;

这是错误:

  

BUILD FAILED /Users/ayman/adt/sdk/tools/ant/build.xml:892:The   执行此行时发生以下错误:   /Users/ayman/adt/sdk/tools/ant/build.xml:894:以下错误   执行此行时发生:   /Users/ayman/adt/sdk/tools/ant/build.xml:906:以下错误   执行此行时发生:   /Users/ayman/adt/sdk/tools/ant/build.xml:283:执行失败:   java.io.IOException:无法运行程序   " /Users/ayman/adt/sdk/build-tools/android-4.4W/dx" (在目录中   " / Users / ayman / desktop / androidtest / platforms / android"):error = 13,   许可被拒绝   java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)at   java.lang.Runtime.exec(Runtime.java:620)at   org.apache.tools.ant.taskdefs.launcher.Java13CommandLauncher.exec(Java13CommandLauncher.java:58)     在org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:428)at at   org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:442)at at   org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:628)     at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:669)     在org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:495)     在com.android.ant.DexExecTask.runDx(DexExecTask.java:272)at   com.android.ant.DexExecTask.runDx(DexExecTask.java:235)at at   com.android.ant.DexExecTask.preDexLibraries(DexExecTask.java:154)at at   com.android.ant.DexExecTask.execute(DexExecTask.java:210)at at   org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)     在sun.reflect.GeneratedMethodAccessor4.invoke(未知来源)at   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     在java.lang.reflect.Method.invoke(Method.java:483)at   org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)     在org.apache.tools.ant.Task.perform(Task.java:348)at   org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)     在   org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)     在sun.reflect.GeneratedMethodAccessor4.invoke(未知来源)at   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     在java.lang.reflect.Method.invoke(Method.java:483)at   org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)     在org.apache.tools.ant.Task.perform(Task.java:348)at   org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:396)     在   org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)     在sun.reflect.GeneratedMethodAccessor4.invoke(未知来源)at   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     在java.lang.reflect.Method.invoke(Method.java:483)at   org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)     在org.apache.tools.ant.Task.perform(Task.java:348)at   org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)     在com.android.ant.IfElseTask.execute(IfElseTask.java:124)at   org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)     在sun.reflect.GeneratedMethodAccessor4.invoke(未知来源)at   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     在java.lang.reflect.Method.invoke(Method.java:483)at   org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)     在org.apache.tools.ant.Task.perform(Task.java:348)at   org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)     在com.android.ant.IfElseTask.execute(IfElseTask.java:124)at   org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)     在sun.reflect.GeneratedMethodAccessor4.invoke(未知来源)at   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     在java.lang.reflect.Method.invoke(Method.java:483)at   org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)     在org.apache.tools.ant.Task.perform(Task.java:348)at   org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)     在   org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)     在sun.reflect.GeneratedMethodAccessor4.invoke(未知来源)at   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     在java.lang.reflect.Method.invoke(Method.java:483)at   org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)     在org.apache.tools.ant.Task.perform(Task.java:348)at   org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:396)     在   org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)     在sun.reflect.GeneratedMethodAccessor4.invoke(未知来源)at   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     在java.lang.reflect.Method.invoke(Method.java:483)at   org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)     在org.apache.tools.ant.Task.perform(Task.java:348)at   org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)     在com.android.ant.IfElseTask.execute(IfElseTask.java:120)at at   org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)     在sun.reflect.GeneratedMethodAccessor4.invoke(未知来源)at   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     在java.lang.reflect.Method.invoke(Method.java:483)at   org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)     在org.apache.tools.ant.Task.perform(Task.java:348)at   org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)     在   org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)     在sun.reflect.GeneratedMethodAccessor4.invoke(未知来源)at   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     在java.lang.reflect.Method.invoke(Method.java:483)at   org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)     在org.apache.tools.ant.Task.perform(Task.java:348)at   org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:396)     在   org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)     在sun.reflect.GeneratedMethodAccessor4.invoke(未知来源)at   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     在java.lang.reflect.Method.invoke(Method.java:483)at   org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)     在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 at   org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)     在org.apache.tools.ant.Project.executeTarget(Project.java:1364)at   org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)     在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 at   org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)引起   by:java.io.IOException:error = 13,Permission denied at   java.lang.UNIXProcess.forkAndExec(Native Method)at   java.lang.UNIXProcess。(UNIXProcess.java:185)at   java.lang.ProcessImpl.start(ProcessImpl.java:134)at   java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)... 93 more

     

总时间:5秒命令的错误代码1:ant with args:   调试,-f,/用户/艾曼/桌面/ androidtest /平台/安卓/ build.xml文件,-Dout.dir = Ant的构建,-Dgen.absolute.dir =蚂蚁根   错误:   /用户/艾曼/桌面/ androidtest /平台/安卓/科尔多瓦/编译:   命令失败,退出代码为2       在ChildProcess.whenDone(/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)       在ChildProcess.emit(events.js:98:17)       在maybeClose(child_process.js:755:16)       在Process.ChildProcess._handle.onexit(child_process.js:822:5)

提前致谢

3 个答案:

答案 0 :(得分:0)

尝试

export ANDROID_HOME=/Users/your/path/to/ANDROIDSDK

平台添加前

答案 1 :(得分:0)

  

无法运行程序" /Users/ayman/adt/sdk/build-tools/android-4.4W/dx" (在目录" / Users / ayman / desktop / androidtest / platforms / android"):error = 13,权限被拒绝

听起来你有权限问题。我将权限更改为755或77。

此致

答案 2 :(得分:0)

我通过安装21到18.0.1的更多版本的SDK Build工具解决了这个问题