I recently asked a very similar question, but did not know how to express it. Having received some feedback and examined some of the possible solutions, I now again ask what I consider to be the best explanation for the problem.
My library (parentLib) is used in my Android application, link methods from another library (childLib) are created in this library. Therefore, the application itself uses parentLib (A.jar library), which in turn uses childLib (another .jar library).
The problem is that when an application tries to use something related to a nested library (childLib), it receives a NoClassDefFoundError, which causes the application to crash. I believe this problem is due to the fact that the application cannot resolve the nested dependency.
I canโt use Android library projects since I need source code that is confusing and as clear as possible. I also tried to create these libraries using Android Studio, only to sadly not get the best result.
My options (I think):
Merge libraries
I can potentially combine childLib and parentLib in one .jar library, splitting them into different packages. It will be difficult, although in practice there are about 6 nested libraries for my intended application.
Insist that the client use multiple libraries
Instead of saying to the client: โHere is one simple library (parentLib) for you to use,โ I could say: โThere are 7 different libraries to import (parentLib, childLib, etc.), otherwise nothing will work " Not quite professional!
Other options
I would welcome any other suggestions anyone has!
Thanks in advance.
source share