In Android Studio go to
File -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle
(if on mac) Android Studio -> preferences... -> Build, Execution, Deployment -> Build Tools -> Gradle
Check the 'Offline work' under 'Global Gradle settings'
Note: In newer version of Android studio, View->Tool Windows->Gradle->Toggle button of online/offline
It will reduce 90% gradle build time.
if you just added a new dependency in your gradle you will have to uncheck the offline work or gradle will not be able to resolve the dependencies. After the complete resolving then you you can check the offline work for a faster build
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…