Hello,
I need to generate an apk file using an ant script but I'm having problems in the compile target. To generate automatically the ant script I've used the android tool with the command "android update project". The problem is that this project depends on another project so I need to do a custom compile task. For that reason I've overridden that target: I've copied the compiled task from ant_rules_r3.xml and I've changed the javac task like this (I include the comments of what I've changed):
<!--I've changed the target 1.5 to target 1.6 -->
<javac encoding="UTF8" target="1.6" debug="true" extdirs=""
destdir="${out.classes.absolute.dir}"
bootclasspathref="android.target.classpath"
verbose="${verbose}"
classpath="${extensible.classpath}"
classpathref="android.libraries.jars">
<src path="${source.absolute.dir}" />
<!--My project has two src directories -->
<src path="${source2.absolute.dir}" />
<src path="${gen.absolute.dir}" />
<src refid="android.libraries.src" />
<!--I've added here the src dir of the other project -->
<src path="${dep1.source.absolute.dir}"/>
<classpath>
<!--I've added here the lib dir of the other project -->
<fileset dir="${dep1.external.libs.absolute.dir}" includes="*.jar" />
<fileset dir="${external.libs.absolute.dir}" includes="*.jar" />
<fileset dir="${extensible.libs.classpath}" includes="*.jar" />
</classpath>
</javac>
The problem is that when I compile it (ant compile) I get the following error:
[javac].... cannot find symbol
[javac] symbol : constructor IOException(java.lang.String,java.security.NoSuchAlgorithmException)
[javac] location: class java.io.IOException
[javac] throw new IOException("Algorithm not found", e);
It seems as it's been compiled with JDK 1.5 instead of 1.6 though I have set the target property to 1.6. The java version of my computer is: java version "1.6.0_20". I've also tried to add to javac compiler="javac1.6", but I get the same error.
I've also set in myu build.properties:
ant.build.javac.target=1.6
ant.build.javac.source=1.6
but it doesn't solve the problem. If I set it to 1.3 instead of 1.6 it gets more errors so it seems it is using the JDK I'm setting here.
Any suggestion?
Thanks