"includeAntRuntime" was not set to false in the android ant script, and it gives me the annoying warning every time I build my app.
[javac] /Users/dwang/Library/android/android-sdk-mac_x86/tools/ant/main_rules.xml:361: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
Look at the line 354 of file android-sdk-*/tools/ant/main_rules.xml
<javac encoding="${java.encoding}"
source="${java.source}" target="${java.target}"
debug="true" extdirs=""
destdir="${out.classes.absolute.dir}"
bootclasspathref="android.target.classpath"
verbose="${verbose}"
classpath="${extensible.classpath}"
classpathref="jar.libs.ref">
<src path="${source.absolute.dir}" />
<src path="${gen.absolute.dir}" />
<src refid="project.libraries.src" />
<classpath>
<fileset dir="${extensible.libs.classpath}" includes="*.jar" />
</classpath>
</javac>
And it seems I can not easily fix it without modifying that file directly? Android team, please fix it maybe?
A workaround for the Android SDK is to set the build.sysclasspath
property to "last"
and that will suppress the false warning.
Do this by assigning the property value in the project's build.properties
file.
# You can use this to override default values such as
# 'source.dir' for the location of your java source folder and
# 'out.dir' for the location of your output folder.
out.dir=build
gen.dir=build/gen
# Suppress the javac task warnings about "includeAntRuntime"
build.sysclasspath=last
That's caused by a misfeature introduced in Ant 1.8. Just add an attribute of that name to the javac
task, set it to false, and forget it ever happened.
ie. set the attribue includeAntRuntime
in your javac
Ant task. The Ant User Manual gives the following attribute description: "attribute includeAntRuntime
defaults to yes, unless build.sysclasspath is set. It is usually best to set this to false so the script's behavior is not sensitive to the environment in which it is run".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With