First of all I am rather new to Android development, so excuse me in advance if I do not use the correct semantics. Please feel free to correct me on this.
So I have an Android Studio project which includes:
The pure Java module is a dependency of the Android app module. Now, I want to add an external.jar to the Pure java module. I have done this by adding the jar to pure_java_module\lib\ and everything compiles fine.
The problem is on runtime, the first time the app is trying to access one of the classes in external.jar, it throws a NoClassDefFoundError
.
I have searched long and hard on this website and in Google in general, and all the solutions I have tried failed so far. To mention what I have tried:
I am seriously at a loss here. Any help would be very much appreciated.
Well, eventually I solved it only it's not really a direct solution, it's more of a workaround. I happened to have access to the source code of the external.jar I wanted to use, so I just added the classes and it works fine.
But if someone sees this question and can explain how to add external.jar to a Pure Java module that is a dependency for an Android app module it would be the better solution, as of course you can't always have access to the source code of a library.