ANT problems - could not find symbol

Monkey Targets Forums/Android/ANT problems - could not find symbol

Xaron(Posted 2011) [#1]
Hi all,

I try to add some basic networking and get some errors. Compiling fails because ant can't find some pathes obviously:

compile:
    [javac] D:\Programme\Android\android-sdk\tools\ant\main_rules.xml:384: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 2 source files to D:\Projekte\testnet\test.build\android\bin\classes
    [javac] D:\Projekte\testnet\test.build\android\src\com\hexowar\MonkeyGame.java:31: cannot find symbol
    [javac] symbol  : class util
    [javac] location: package org.apache.http
    [javac] import org.apache.http.util;
    [javac]                       ^


I know that ant obviously doesn't know about some packages and I have to add these path lines into the build.xml.

There is a build.properties file in the targets folder:

# This file is used to override default values used by the Ant build system.
# 
# This file must be checked in Version Control Systems, as it is
# integral to the build system of your project.

# This file is only used by the Ant script.

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

# You can also use it define how the release builds are signed by declaring
# the following properties:
#  'key.store' for the location of your keystore and
#  'key.alias' for the name of the key to use.
# The password will be asked during the build when you use the 'release' target. 


Any idea what I have to add to solve that issue?

edit: I found something related to that topic but still scratch my head about this... http://www.avajava.com/tutorials/lessons/how-do-i-compile-my-project-using-ant.html?page=1

edit2: I guess it has something to do with these lines in the build.xml?

    <!-- Custom Android task to deal with the project target, and import the proper rules.
         This requires ant 1.6.0 or above. -->
    <path id="android.antlibs">
        <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
        <pathelement path="${sdk.dir}/tools/lib/sdklib.jar" />
        <pathelement path="${sdk.dir}/tools/lib/androidprefs.jar" />
        <pathelement path="${sdk.dir}/tools/lib/apkbuilder.jar" />
        <pathelement path="${sdk.dir}/tools/lib/jarutils.jar" />
    </path>



Thanks!


Xaron(Posted 2011) [#2]
Looks like I have to add some apache binaries...

http://hc.apache.org/downloads.cgi


Xaron(Posted 2011) [#3]
Alright, forget that. I got it to work just with plain java.net. :)

Focusing on the next targets...