Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3231774
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:05:03+00:00 2026-05-17T17:05:03+00:00

I need to generate an apk file using an Ant script, but I’m having

  • 0

I need to generate an apk file using an Ant script, but I’m having problems with the compile target. To automatically generate 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 use 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 (see comments for what I 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 with 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 though it’s been compiled with JDK 1.5 instead of 1.6 even though I have set the target property to 1.6. My computer is using Java version 1.6.0_20.

I’ve tried using javac compiler="javac1.6", but I get the same error.

I’ve also set in my build.properties:

ant.build.javac.target=1.6
ant.build.javac.source=1.6

but it doesn’t solve the problem either. Setting it to 1.3 instead of 1.6 causes more errors, so it seems it is using the JDK I’m setting here.

How can I get this to compile correctly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T17:05:04+00:00Added an answer on May 17, 2026 at 5:05 pm

    Because you’ve specified the bootclasspath to use the Android SDK classes, these will probably be the ones that contain the IOException class that does not implement the two-arg constructor with a Throwable second arg. That constructor was new in Java 6, but according to recent Android (2.2) docs, the Android version only has Java-1.5 style constructors, and doesn’t implement the two newer constructors that take Throwable args.

    You didn’t mention whether you’d got this to build successfully before bringing in the second project – so I’d recommend checking your local Android boot classes to see what constructors IOException offers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need generate thumbnails for a bunch of jpegs (200,000+) but I want to
I need to generate an XML file in C#. I want to write the
I need to generate the .bin file that contains the VBA macro part of
I need to generate a random integer between 1 and n (where n is
I need to generate some passwords, I want to avoid characters that can be
I need to generate thumbnails from a set of jpg's that need to have
I need to generate a directory in my makefile and I would like to
I need to generate multiple random values under SQL Server 2005 and somehow this
I need to generate a new interface at run-time with all the same members
We need to generate LINQ queries which are 100% unknown during coding (design time).

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.