N
N
Nurshat2017-04-16 20:42:31
Java
Nurshat, 2017-04-16 20:42:31

How to compile a library with third party libraries?

Good day to all.
I'm trying to write a library for android, and it turned out that in order to implement some functionality, you need to connect some third-party libraries.
I convert the resulting library into an aar file according to this guide and, following the same guide , I connect it to another project.
But when I try to compile this project, I get the following error.
417c80a1fd9b4c238f6fc77ba0238141.PNG
Apparently, when compiling the library into an aar file, either some of the resources were lost, or some links were lost.
And here in what actually a question: how to correct the given situation?
In the same instruction, I found the following lines
A library module can depend on an external JAR library
You can develop a library module that depends on an external library. (for example, the Maps external library). In this case, the dependent app must build against a target that includes the external library (for example, the Google APIs Add-On). Note also that both the library module and the dependent app must declare the external library in their manifest files, in a element.
I tried to do so in the manifest
cd6b57bfdbdf483580dd683672c2885a.PNG
. Unfortunately, it did not help, the error did not go away.
PS It is possible that I might have missed something fundamental and "obvious" when writing the library, since I have absolutely no experience in this.
PPS The problem was found, it lies in the fact that when compiled into aar, gradle does not save the list of external dependencies. The solution might be to use maven, it should create a pom file with a list of all external dependencies. But then there was a problem with using maven, there is a plugin for gredl, but I could not figure out how it works, people use black magic, apparently, here and here , but for me it is not yet understandable, I will be glad for any help.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question