I made my BuildConfig in modules enabled using this article, the article also has a guide on how to improve build speed https://medium.com/androiddevelopers/5-ways-to-prepare-your-app-build-for-android-studio-flamingo-release-da34616bb946