Ant Create an Android project with dependencies

I am trying to create an application (call it android-app ) with SDK dependency (call it sdk ) via Ant. Eclipse is not installed on this computer (for argument, this is a CI box with Jenkins).

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

Suppose both vanilla projects have not been built with Ant before. I cd to the directory ../android-app/workspace and run android update project -p . --library ~/.jenkins/jobs/sdk/workspace android update project -p . --library ~/.jenkins/jobs/sdk/workspace . Then I cd to the ../sdk/workspace directory and run android update project -p . .

At this point, I cd go back to the ../android-app/workspace directory and run ant clean build . Error with 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 into the sdk workspace and open project.properties , I get the following:

 # ProGuard proguard.config=proguard.cfg # Project target. target=android-10 android.library=true 

He exists. So, all 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 something more.

+4
source share
2 answers

Well, I also run into this problem.

I use strace to find out what the hell is going on and find that the path you specified in project.properties will be added to your prefix of the current folder path.

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

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

Then the path will become / Home / my_folder / project / path / to / Library

+10
source

Just to fill in the blank of the answer, my version of Java was completely disabled. I am very confused.

+2
source

Source: https://habr.com/ru/post/1432822/


All Articles