Answer the question
In order to leave comments, you need to log in
How to connect an external library (.jar) to an Android project without using an IDE?
Hello!
There was such a problem:
1) I create an application through the console like this: android create project ...
2) I collect the project through ant debug / release
3) There was a need to add an external library (.jar) to this application. But it doesn't work out. Tried options:
- adding lines like jar.libs.dir=... external.libs.dir=...
to ant.properties - adding similar lines to build.xml properties
- stupidly putting the necessary jar files in the libs subdirectory or global lib (well, yes,
creating a .classpath file and writing paths there
is not a boyish option at all).
Nobody faced this? Maybe there is a solution?
Thanks in advance!
ps Eclipse for a number of reasons, including religious ones, does not want to be used.
Answer the question
In order to leave comments, you need to log in
Do you also want to use other IDEs (Intellij IDEA, NetBeans)?
Your question : ant by default takes jar archives from the libs folder.
There are now two standard (recommended by Google) build tools: ant and gradle, and in the near future, apparently, only gradle will remain.
You can specify the location of jar archives in the gradle build script like this:
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question