2014-09-25 76 views
0

這對我來說是無法解釋的。cordova運行android意外不工作,顯然與build.xml和aidl有關

有一分鐘我在更改我的科爾多瓦應用程序中的HTML,下一分鐘cordova run android失敗,出現下面的錯誤代碼。

它沒有意義,因爲我從來沒有安裝任何東西,我沒有觸及build.xml文件,所以它怎麼會失敗?我該如何解決這個問題,甚至去調查發生的事情?

這就是說錯誤是在行659上的一個ArrayIndexOutOfBounds錯誤。當我檢查構建xml的第659行時,它指的是aidl。我甚至不知道aidl是什麼......我也包括build xml的那一部分。

任何建議,將不勝感激......

BUILD FAILED 
C:\adt-bundle-windows-x86_64-20131030\sdk\tools\ant\build.xml:653: The following 
error occurred while executing this line: 
C:\adt-bundle-windows-x86_64-20131030\sdk\tools\ant\build.xml:659: java.lang.Arr 
ayIndexOutOfBoundsException: 1 
    at com.android.ant.DependencyGraph.parseDependencyFile(DependencyGraph.java:180) 
    at com.android.ant.DependencyGraph.<init>(DependencyGraph.java:54) 
    at com.android.ant.MultiFilesTask.processFiles(MultiFilesTask.java:89) 
    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) 

Total time: 5 seconds 
Error: C:\Users\Terence\Documents\Code\IceBreaker\platforms\android\cordova\build.bat: 
Command failed with exit code 2 
    at ChildProcess.whenDone (C:\Users\Terence\AppData\Roaming\npm\node_modules\ 
cordova\node_modules\cordova-lib\src\cordova\superspawn.js:135:23) 
    at ChildProcess.emit (events.js:98:17) 
    at maybeClose (child_process.js:755:16) 
    at Process.ChildProcess._handle.onexit (child_process.js:822:5) 

的build.xml

652  <do-only-if-manifest-hasCode 
653    elseText="hasCode = false. Skipping aidl/renderscript/R.java"> 
654    <echo level="info">Handling aidl files...</echo> 
655    <aidl executable="${aidl}" 
656     framework="${project.target.framework.aidl}" 
657     libraryBinAidlFolderPathRefid="project.library.bin.aidl.folder.path" 
658     genFolder="${gen.absolute.dir}" 
659     aidlOutFolder="${out.aidl.absolute.dir}"> 
660     <source path="${source.absolute.dir}"/> 
661    </aidl> 

回答

0

呃的相關章節。

在這裏找到了答案:

Cordova won't build anymore

答案是刪除平臺ant-buildant-gen文件夾\ Android的

不解釋或暗示它涉及到什麼,但什麼有效。 wtf ...