I have a project with 14 modules and 7 layouts. I think generation is too slow... what should I pay attention to in order to reduce the generation time? libraries (21)? assets folders? or what?
This is indeed slow. The number of libraries is not really important as any library that is based on Google Play Services will add many other components which will outweigh all other libraries.
The first step is to increase MaxRamForDex in the ini file.