ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeffrey Walton <>
Subject Re: Specify source file language in build.xml?
Date Tue, 17 Feb 2015 20:58:56 GMT
On Tue, Feb 17, 2015 at 3:17 PM, Earl Hood <> wrote:
> On Tue, Feb 17, 2015 at 2:11 PM, Jeffrey Walton wrote:
>> I'm trying to build an Android project from the command line. I'm
>> getting an error during `ant release`. The error is unmappable
>> character for encoding UTF-8.
> Use the 'encoding' attribute to the <javac> task.

Thanks Eric.

It looks like build.xml brings in
$ANDROID_SDK_ROOT/tools/ant/build.xml, and Android's build.xml uses

$ cat "$ANDROID_SDK_ROOT/tools/ant/build.xml" | grep -A 10 javac
            <javac encoding="${java.encoding}"
                    source="${java.source}" target="${}"
                    debug="true" extdirs="" includeantruntime="false"
                <src path="${source.absolute.dir}" />
                <src path="${gen.absolute.dir}" />
                <compilerarg line="${java.compilerargs}" />

I tried adding the following to the project's build.xml (not Android's
build.xml), but with no joy. It results in same/similar errors:

    <property name="java.encoding" value="ascii" />

I also tried to add the following to the project's build.xml (not
Android's build.xml):

     <javac encoding="ascii" />

But it results in:

    build.xml:115: srcdir attribute must be set!

I know ASCII is probably wrong. I'm just trying to get a toehold on
the fix at the moment).

How, exactly, do I specify the 'encoding' attribute to the <javac> task?

Sorry to ask. I'm not sure where the delineation between Ant problems
and Android problems occurs (should I be asking on an Android list?).
And all of this is modulo the problem of me being inexperienced and
wondering why comments are not being ignored (ignoring comments would
make this a non-sequitur).


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message