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 8736331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:16:54+00:00 2026-06-13T10:16:54+00:00

As Android Java projects use Ant as a build tool, using Ivy for dependency

  • 0

As Android Java projects use Ant as a build tool, using Ivy for dependency management seems like a natural choice to me. However, while the basic setup works fine, I’m running into a strange issue. I’ve created a fork of an existing example on GitHub to easily reproduce the problem.

The point is, dependencies get downloaded into the “libs” directory just fine, but the build process as invoked by ant debug does not seem to find the JARs. However, it works fine if I call the “resolve” target not as part of my overloaded “-pre-build” target, but manually like in ant resolve debug.

I have verified that the libraries are really in “libs” just before “-pre-build” finishes (by listing the files in “libs” as part of the “-pre-build” target), so I’m really wondering why they cannot be found.

To reproduce, it’s important to delete the libraries from “libs” before running ant. Any ideas what’s going wrong here?

resolve:
[ivy:retrieve] :: Apache Ivy 2.3.0-rc1 - 20120416000235 :: http://ant.apache.org/ivy/ ::
[ivy:retrieve] :: loading settings :: file = /Users/seschube/development/IvyAndroidExample/ivysettings.xml
[ivy:retrieve] :: resolving dependencies :: com.example#ivy-android-example;0.1
[ivy:retrieve]  confs: [default]
[ivy:retrieve]  found org.acra#acra;4.2.3 in acra
[ivy:retrieve]  found com.google.inject#guice;2.0-no_aop in maven2
[ivy:retrieve]  found com.google.zxing.core#core;1.6 in zxing
[ivy:retrieve] :: resolution report :: resolve 115ms :: artifacts dl 5ms
    ---------------------------------------------------------------------
    |                  |            modules            ||   artifacts   |
    |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
    ---------------------------------------------------------------------
    |      default     |   3   |   0   |   0   |   0   ||   4   |   0   |
    ---------------------------------------------------------------------
[ivy:retrieve] :: retrieving :: com.example#ivy-android-example
[ivy:retrieve]  confs: [default]
[ivy:retrieve]  4 artifacts copied, 0 already retrieved (1195kB/76ms)

-pre-build:
     [echo] The "libs" directory contains: acra-4.2.3.jar;core-1.6.jar;guice-2.0-no_aop-javadoc.jar;guice-2.0-no_aop.jar

-code-gen:
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
     [echo] Handling aidl files...
     [aidl] No AIDL files to compile.
     [echo] ----------
     [echo] Handling RenderScript files...
[renderscript] No RenderScript files to compile.
     [echo] ----------
     [echo] Handling Resources...
     [aapt] Generating resource IDs...
     [echo] ----------
     [echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.

-pre-compile:

-compile:
    [javac] Compiling 3 source files to /Users/seschube/development/IvyAndroidExample/bin/classes
    [javac] /Users/seschube/development/IvyAndroidExample/src/com/example/IvyAndroidExampleActivity.java:7: error: package org.acra does not exist
    [javac] import org.acra.*;
    [javac] ^
    [javac] /Users/seschube/development/IvyAndroidExample/src/com/example/IvyAndroidExampleActivity.java:8: error: package com.google.inject does not exist
    [javac] import com.google.inject.*;
    [javac] ^
    [javac] /Users/seschube/development/IvyAndroidExample/src/com/example/IvyAndroidExampleActivity.java:9: error: package com.google.zxing does not exist
    [javac] import com.google.zxing.*;
    [javac] ^
    [javac] 3 errors

BUILD FAILED
  • 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-06-13T10:16:55+00:00Added an answer on June 13, 2026 at 10:16 am

    I’ve found out what’s going on: The Android SDK’s build.xml adds all JARs from the libs directory to the project.all.jars.path property as part of the -build-setup target. But this is too early if Ivy’s retrieve target is called as part of -pre-build, because -build-setup is called before -pre-build. So -pre-build, although meant to be overridden, is the wrong place. As there seems to be no other “dummy” target meant to be overridden before -build-setup is called, I’m now overriding -build-setup in my build.xml file with a version that depends on retrieve and the original -build-setup like this:

    <target name="-build-setup" depends="retrieve,android_rules.-build-setup" />.

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

Sidebar

Related Questions

We currently build our Android (Java) projects using the built-in Eclipse build tools. Then
I made an android project using eclipse. It looks like: src/ ActivityMain.java lib/ Square.java
I'm trying to create an Android library JAR and would like to use ant
I am trying to build my Android project with Ant. Whenever I use Eclipse
I have a Java Project, where i would like to use Android LogCat's debug-tagging
I would like to build two versions of my Android application using an Apache
I have Android and pure java projects. I want to use code from pure
I configured my android project to use ant. When building using the keyword release
I'm using ant to compile my android projects into debug apks. But sometimes when
I'm trying to use sbt to compile an Android Project made in Java, which

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.