B
B
BelBES2014-02-28 16:24:00
Java
BelBES, 2014-02-28 16:24:00

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

4 answer(s)
A
Aliaksei Trafimchyk, 2014-02-28
@AT547

Have you tried Maven or Gradle?

V
Vladislav Onishchenko, 2014-02-28
@STFBEE

Do you also want to use other IDEs (Intellij IDEA, NetBeans)?

F
FoxInSox, 2014-02-28
@FoxInSox

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')
}

M
Mintormo, 2014-03-01
@Mintormo

This won't fit? habrahabr.ru/post/210584 There, from scratch, the assembly of the application.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question