https://kotlinlang.org logo
Title
c

Christopher Elías

08/12/2020, 12:10 AM
Hello everyone! Im doing a native android app with a feature modularization architecture. But my builds are getting slower and slower... Even thought I already enable caching, parallel and the gradle daemon on gradle.propierties... I think it has something to do with dagger implemented in all the feature modules gradle with "api" instead of "implementation". But if I dont use api, then dagger throw compilation error. Does anyone have experienced something like this? Please help!!
n

no

08/12/2020, 7:19 AM
when using
implementation
instead of
api
you'll also have to redeclare your dependencies in the consuming module. i doubt this will affect build times though. it is likely something else. you can use a build scan to see what is taking time: https://scans.gradle.com/
👍 1
j

Joost Klitsie

08/12/2020, 7:27 AM
Android studio (from 4.0) also shows build times with the build analyzer https://developer.android.com/studio/build/build-analyzer
👍 1
c

Christopher Elías

08/12/2020, 8:50 PM
This is my project currently, but on every gradle that needs some dependency I have to add:
api Dependencies.dagger
    api Dependencies.daggerAndroidSupport
    kapt Dependencies.daggerCompiler
    kapt Dependencies.daggerAndroidProcessor
If use "implementation" instead of "api" then the console will throw errors. A clean build could take like 4 - 7 mins, aftaer that a few seconds, but if I work on multiple features then the build take again 4-7 mins. The project also have DataBinding, I don't know if there is something else I can do to speed up the compile times. Also I see than when I made a change all the tasks run again... Also, none of my features are implementing each other. My feature library modules only depend on the core modules. And the App module implement all modules (core and features) for construct the dagger graph...
n

no

08/12/2020, 9:14 PM
A build scan will give you insight in to what you can improve in your build. Run the build with
--scan
or check the guide at scans.gradle.com