Create lib from android app screen
My current task is to separate one of the application screens as a library so that another application can have it and keep all the functionality of the screen
The screen consists of 3 modules of clean architecture: Ui
, Domain
& Data
and it works fine in the application. Also, we have some utills modules in UI
& Data
layers.
Our modules have the com.android.library
plugin
How can I create such feature as a library without changing the current architecture of the project (i.e. keep the current modules intact)
And I also think that there will be problems combining the DI
code of the library and the client code. (We use Koin
). But now it is not big problem.
Attempts
I tried to build the AAR
library from the UI
module using the gradle assemble
task, however, it did not have the rest of the clean layers, which is why I got java.lang.NoClassDefFoundError: Failed resolution of...
.
In this case, I could only invoke the functions of the imported module
Can I combine several AAR
files into one? As variant, I can try use fat-aar-lib -> Building aar library from multimodule project. But it seems like not modern solution.
We do not consider the option of moving the functionality to a separate project and repository, because it will be difficult to maintain in future
Also, earlier we tried to make composite builds, but it was very slow and forced us to have all the source code (of the project) locally, so we abandoned this option