will help you If you are like me who already tried Vic Vu's solution but still can't avoid enabling multiDex then you can try this (as long as your are using a device that has Android 5.0 and above). Note This will only speed up your development build. Your production build will still be slow.
// Define separate dev and prod product flavors.
// dev utilizes minSDKVersion = 21 to allow the Android gradle plugin
// to pre-dex each module and produce an APK that can be tested on
// Android Lollipop without time consuming dex merging processes.
// The actual minSdkVersion for the application.
it fixes the issue So a branch was merged in at my work and now I'm getting too slow of build times. The only new addition to the gradle file was these two dependencies : , The issue was with a query with Room was too long and complicated.