錯誤是在底部
嘗試運行build.xml文件,當我在-build-setup
任務期間收到此錯誤(由android sdk生成)爲一個項目,有一對夫婦依賴和我試圖運行的任務是-compile
。我使用eclipse來使用自動構建函數來運行這個ant文件。我將這個build.xml
文件作爲項目的構建者,並將其設置爲唯一的bulider。然後設定的目標爲以下:
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_AFTER_CLEAN_TARGETS" value="-compile,"/>
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_AUTO_TARGETS" value="-compile,"/>
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_CLEAN_TARGETS" value="clean,"/>
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_MANUAL_TARGETS" value="clean,nodeps,debug,"/>
兩者的依存關係也在利用產生build.xml
文件。我所有的build.xml
文件都在執行-compile
任務。發佈在底部是build.xml
文件中的-compile
任務。
的依賴項目的Android庫,我已經在Eclipse配置爲如下的Ant構建:
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_AFTER_CLEAN_TARGETS" value="nodeps,debug,"/>
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_AUTO_TARGETS" value="nodeps,debug,"/>
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_CLEAN_TARGETS" value="clean,"/>
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_MANUAL_TARGETS" value="debug,"/>
爲什麼我不斷收到這個錯誤,我該如何解決這一問題?
我目前的工作圍繞
如果我改變AppNameA
的目標,以下面,它工作正常。但是,我不想這麼做......當你真正想要的是在這些點上進行編譯時,調試需要很長的時間。
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_AFTER_CLEAN_TARGETS" value="debug,"/>
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_AUTO_TARGETS" value="debug,"/>
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_CLEAN_TARGETS" value="clean,"/>
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_MANUAL_TARGETS" value="clean,nodeps,debug,"/>
這裏是確切的錯誤:
BUILD FAILED
C:\Users\myusername\android-sdks\tools\ant\build.xml:485: The following error occurred while executing this line:
Target "${build.target}" does not exist in the project "AppNameA".
的-compile
任務是在build.xml
文件。
(基本上跟原來一樣,有一個微小的變化......)
<!-- Compiles this project's .java files into .class files. -->
<target name="-compile" depends="-build-setup, -pre-build, -code-gen, -pre-compile">
<do-only-if-manifest-hasCode elseText="hasCode = false. Skipping...">
<!-- If android rules are used for a test project, its classpath should include
tested project's location -->
<condition property="extensible.classpath"
value="${tested.project.absolute.dir}/bin/classes"
else=".">
<isset property="tested.project.absolute.dir" />
</condition>
<condition property="extensible.libs.classpath"
value="${tested.project.absolute.dir}/${jar.libs.dir}"
else="${jar.libs.dir}">
<isset property="tested.project.absolute.dir" />
</condition>
<javac encoding="${java.encoding}"
source="${java.source}" target="${java.target}"
debug="true" extdirs="" includeantruntime="false"
destdir="${out.classes.absolute.dir}"
bootclasspathref="android.target.classpath"
verbose="${verbose}"
classpath="${extensible.classpath}"
classpathref="jar.libs.ref"
excludes="${filesToExcludeFromCompile}"
failonerror="true"
>
<src path="${source.absolute.dir}" />
<src path="${gen.absolute.dir}" />
<classpath>
<fileset dir="${extensible.libs.classpath}" includes="*.jar" />
</classpath>
<compilerarg line="${java.compilerargs}" />
</javac>
<!-- if the project is a library then we generate a jar file -->
<if condition="${project.is.library}">
<then>
<echo>Creating library output jar file...</echo>
<property name="out.library.jar.file" location="${out.absolute.dir}/classes.jar" />
<if>
<condition>
<length string="${android.package.excludes}" trim="true" when="greater" length="0" />
</condition>
<then>
<echo>Custom jar packaging exclusion: ${android.package.excludes}</echo>
</then>
</if>
<jar destfile="${out.library.jar.file}">
<fileset dir="${out.classes.absolute.dir}" excludes="**/R.class **/R$*.class"/>
<fileset dir="${source.absolute.dir}" excludes="**/*.java ${android.package.excludes}" />
</jar>
</then>
</if>
<!-- if the project is instrumented, intrument the classes -->
<if condition="${build.is.instrumented}">
<then>
<echo>Instrumenting classes from ${out.absolute.dir}/classes...</echo>
<!-- It only instruments class files, not any external libs -->
<emma enabled="true">
<instr verbosity="${verbosity}"
mode="overwrite"
instrpath="${out.absolute.dir}/classes"
outdir="${out.absolute.dir}/classes">
</instr>
<!-- TODO: exclusion filters on R*.class and allowing custom exclusion from
user defined file -->
</emma>
</then>
</if>
</do-only-if-manifest-hasCode>
</target>
您可以提供示例代碼和xml以瞭解您如何解決此問題?由於 – Lisa 2012-07-24 09:25:24
你可能嘗試從您的自定義'-compile'目標中調用'-set-調試mode'目標。把它稱爲你做的第一件事。但是我們實際上放棄了這個想法,並且認爲不值得嘗試在eclipse中使用我們的外部構建過程。所以,我無法進一步測試它。 – prolink007 2012-07-24 13:26:58