Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"includeAntRuntime" was not set for android ant script? [duplicate]

Tags:

android

sdk

ant

"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?

like image 533
dongshengcn Avatar asked Jan 27 '11 19:01

dongshengcn


2 Answers

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
like image 147
ohhorob Avatar answered Oct 03 '22 18:10

ohhorob


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".

like image 42
Tanmay Mandal Avatar answered Oct 03 '22 17:10

Tanmay Mandal