2015-06-13 66 views
2

我想在Android設備上運行最簡單的Qt應用程序。有AVD和Android的真正的手機。對於他們兩人我得到的錯誤:爲什麼BUILD失敗?

BUILD FAILED 
/home/user1/dev/android-sdk-linux/tools/ant/build.xml:649: The following error occurred while executing this line: 
/home/user1/dev/android-sdk-linux/tools/ant/build.xml:655: Execute failed: java.io.IOException: Cannot run program "/home/user1/workspace/build-Test11123-Android_for_armeabi_v7a_GCC_4_9_Qt_5_4_2-Debug/android-build/${aidl}": error=2, No such file or directory 
     at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047) 
     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.AidlExecTask$AidlProcessor.process(AidlExecTask.java:102) 
     at com.android.ant.MultiFilesTask.processFiles(MultiFilesTask.java:131) 
     at com.android.ant.AidlExecTask.execute(AidlExecTask.java:203) 
     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.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:186) 
     at java.lang.ProcessImpl.start(ProcessImpl.java:130) 
     at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028) 
     ... 48 more 

Total time: 0 seconds 
Building the android package failed! 
    -- For more information, run this command with --verbose. 
16:30:43: The process "/opt/Qt/5.4/android_armv7/bin/androiddeployqt" exited with code 14. 
Error while building/deploying project Test11123 (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.4.2)) 
When executing step "Build Android APK" 

Building Qt Android App fails沒有幫助我。

的Qt 5.4.2
QtCreator 3.4.1
銀河S4主動
AVD:API等級22 armeabi-V7A
的Java 7的OpenJDK-AMD64

回答

6

我有同樣的問題。添加這些行的build.xml文件解決它:

<property name="aidl" location="${sdk.dir}/build-tools/22.0.1/aidl${exe}" /> 
<property name="aapt" location="${sdk.dir}/build-tools/22.0.1/aapt${exe}" /> 
<property name="dx" location="${sdk.dir}/build-tools/22.0.1/dx${exe}" /> 
<property name="zipalign" location="${sdk.dir}/build-tools/22.0.1/zipalign${exe}" /> 
+0

+1這爲我工作。我必須在「exe」定義之後添加它,即接近「adb」和「lint」的定義。 –

0

似乎有些Android的SDK版本(22,例如)在螞蟻的build.xml缺少的工具。所以上面在mastertoster的答案中描述的行應該被添加到<sdk root>/tools/ant/build.xml文件中。