Ошибка внизу
Я получаю эту ошибку при выполнении задачи -build-setup
при попытке запустить файл build.xml (созданный Android-SDK) для проектау него есть пара зависимостей, и задача, которую я пытаюсь запустить, - -compile
.Я использую eclipse для запуска этого файла муравья, используя функцию автоматической сборки.Я назначил этот build.xml
файл в качестве компоновщика проекта и установил его в качестве единственного блока.Затем установите цели следующим образом:
<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
.Внизу приведена задача -compile
, которая находится в файлах build.xml
.
Проекты зависимостей - это библиотеки Android, и их сборщик муравьев настроен в eclipse следующим образом:
<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>