Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ant Build Android Project With Dependencies

I'm trying to build an app (let's call it android-app) with a dependency on an SDK (let's call it sdk) via Ant. Eclipse is not installed on this computer (for reasoning, it's a CI box with Jenkins).

Both projects are in two completely separate directories side by side. android-app is in the directory ~/.jenkins/jobs/android-app/workspace and sdk is in the directory ~/.jenkins/jobs/sdk/workspace.

Let's assume both projects are "vanilla" and have not been built with Ant before. I cd to the ../android-app/workspace directory and run android update project -p . --library ~/.jenkins/jobs/sdk/workspace which passes. I then cd to the ../sdk/workspace directory and run android update project -p . which also passes.

At this point I cd back to the ../android-app/workspace directory and run ant clean build. It fails with the error:

BUILD FAILED
/path/to/ant/build.xml:440: 
/path/to/sdk/workspace resolve to a path with no project.properties file for 
project /path/to/android-app/workspace

... where /path/to is the full path to the directories. I simplified it here.

If I cd to the sdk workspace and open project.properties, I receive the following:

# ProGuard
proguard.config=proguard.cfg

# Project target.
target=android-10
android.library=true

It does exist. So do all of these files:

ls

So, why is this failing? What am I doing wrong? I tried to provide as many details as possible. Please let me know if I can provide anything additional.

like image 773
Baub Avatar asked Dec 16 '22 19:12

Baub


1 Answers

Well, I encounter this problem too.

I use strace to find out what the hell is going on and found that the path you specified in project.properties will be appended with your current folder path as its prefix.

For example, /home/myfolder/project > ant debug

And the library you specified in project.properties is /path/to/library

Then, the path will become /home/myfolder/project/path/to/library

like image 102
user1957140 Avatar answered Dec 29 '22 08:12

user1957140