1号楼的Andr​​oid的Hello

1号楼的Andr​​oid的Hello

本文介绍了科尔多瓦:蚂蚁错误code 1号楼的Andr​​oid的Hello World应用程序时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

清洁的Ubuntu 12.04科尔多瓦安装,再装Android的ADT包,并增加了平台​​及工具的路径。
然后,在阿帕奇科尔多瓦创建从toturial的Hello应用程序。但它拒绝建立。

Clean install of Cordova on an Ubuntu 12.04, then installed Android ADT bundle and added the platform-tools and tools to the path.Then created the hello app from toturial at apache Cordova. but it refuses to build.

请参阅错误我收到:

aus@devhost:/opt/android_app/hello$ cordova build
Running command: /opt/android_app/hello/platforms/android/cordova/build
Buildfile: /opt/android_app/hello/platforms/android/build.xml

-set-mode-check:

-set-debug-files:

-check-env:
 [checkenv] Android SDK Tools Revision 22.6.2
 [checkenv] Installed at /opt/android_app/hello/adt-bundle-linux-x86_64-20140321/sdk

-setup:
     [echo] Project Name: HelloWorld
  [gettype] Project Type: Application

-set-debug-mode:

-debug-obfuscation-check:

-pre-build:

-build-setup:
[getbuildtools] Using latest Build Tools: 19.0.3
     [echo] Resolving Build Target for HelloWorld...
[gettarget] Project Target:   Android 4.4.2
[gettarget] API level:        19
     [echo] ----------
     [echo] Creating output directories if needed...
     [echo] ----------
     [echo] Resolving Dependencies for HelloWorld...
[dependency] Library dependencies:
[dependency]
[dependency] ------------------
[dependency] Ordered libraries:
[dependency]
[dependency] ------------------
     [echo] ----------
     [echo] Building Libraries with 'debug'...

nodeps:

-set-mode-check:

-set-debug-files:

-check-env:
 [checkenv] Android SDK Tools Revision 22.6.2
 [checkenv] Installed at /opt/android_app/hello/adt-bundle-linux-x86_64-20140321/sdk

-setup:
     [echo] Project Name: CordovaLib
  [gettype] Project Type: Android Library

-set-debug-mode:

-debug-obfuscation-check:

-pre-build:

-build-setup:
[getbuildtools] Using latest Build Tools: 19.0.3
     [echo] Resolving Build Target for CordovaLib...
[gettarget] Project Target:   Android 4.4.2
[gettarget] API level:        19
     [echo] ----------
     [echo] Creating output directories if needed...
    [mkdir] Created dir: /opt/android_app/hello/platforms/android/CordovaLib/ant-   build/rsObj
    [mkdir] Created dir: /opt/android_app/hello/platforms/android/CordovaLib/ant-build/rsLibs
     [echo] ----------
     [echo] Resolving Dependencies for CordovaLib...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------

-code-gen:
[mergemanifest] No changes in the AndroidManifest files.
     [echo] Handling aidl files...
     [aidl] No AIDL files to compile.
     [echo] ----------
     [echo] Handling RenderScript files...
     [echo] ----------
     [echo] Handling Resources...
     [aapt] Generating resource IDs...

BUILD FAILED
/opt/android_app/hello/adt-bundle-linux-x86_64-20140321/sdk/tools/ant/build.xml:601: The following error occurred while executing this line:
/opt/android_app/hello/adt-bundle-linux-x86_64-20140321/sdk/tools/ant/build.xml:653: The following error occurred while executing this line:
/opt/android_app/hello/adt-bundle-linux-x86_64-20140321/sdk/tools/ant/build.xml:698:     Execute failed: java.io.IOException: Cannot run program "/opt/android_app/hello/adt-bundle-linux-x86_64-20140321/sdk/build-tools/android-4.4.2/aapt" (in directory "/opt/android_app/hello/platforms/android/CordovaLib"): 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:41)
 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:440)
 at org.apache.tools.ant.taskdefs.SubAnt.execute(SubAnt.java:303)
 at org.apache.tools.ant.taskdefs.SubAnt.execute(SubAnt.java:221)
 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.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)
 ... 68 more

Total time: 1 second
Error code 1 for command: ant with args: debug,-    f,/opt/android_app/hello/platforms/android/build.xml,-Dout.dir=ant-build,-    Dgen.absolute.dir=ant-gen
Error: /opt/android_app/hello/platforms/android/cordova/build: Command failed with exit code 2
    at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
    at ChildProcess.EventEmitter.emit (events.js:110:17)
    at maybeClose (child_process.js:992:16)
    at Process.ChildProcess._handle.onexit (child_process.js:1064:5)

任何想法我失踪?不似乎是依赖关系,我安装NPM,科尔多瓦,JDK 7,Android SDK中,蚂蚁,期间没有出现错误等的NodeJS

Any ideas what i'm missing? doesn't seems to be dependencies, I didn't get errors during the installation of npm, cordova, jdk-7, android sdk, ant, nodejs etc.

此外,它指的是build.xml中的错误消息,该文件存在与内容。但是当我用蚂蚁尝试直接获得:

Also, in the error message it refers to build.xml, that file exists with content. but when I try it with ant directly I get:

aus@devhost:/opt/android_app/hello$ ant /opt/android_app/hello/platforms/android/build.xml
Buildfile: build.xml does not exist!
Build failed

或许应该使用ant这样的,但我不得不尝试。

probably should use ant like that but I had to try.

所以,解决办法是运行这些命令:
须藤dpkg的--add-i386硬件架构
sudo易于得到-qqy更新
sudo易于得到-qqy安装中的libncurses5:I386的libstdc ++ 6:I386的zlib1g:I386

So the solution was to run those commands:sudo dpkg --add-architecture i386sudo apt-get -qqy updatesudo apt-get -qqy install libncurses5:i386 libstdc++6:i386 zlib1g:i386

appearantly Android SDK中有在32位建筑风格,一些依赖。

appearantly android sdk have some dependency on 32bit architechture.

推荐答案

检查是否存在/opt/android_app/hello/adt-bundle-linux-x86_64-20140321/sdk/build-tools/android-4.4.2/aapt 。如果它确实存在,请检查下面的链接,提供了一个修补程序。它看起来像AAPT对zlib的依赖,这是唯一的i386架构,所以你需要补充的是建筑和LIB本身。

Check if /opt/android_app/hello/adt-bundle-linux-x86_64-20140321/sdk/build-tools/android-4.4.2/aapt exists. If it does exist please check the link below that provides a fix. It looks like aapt has a dependency on zlib, which is available in i386 architecture only, so you'll need to add that architecture and the lib itself.

Android's AAPT不能在64位的Ubuntu 13.10(无IA32-库)上运行。我该如何解决这个问题?

这篇关于科尔多瓦:蚂蚁错误code 1号楼的Andr​​oid的Hello World应用程序时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 14:17