1.开启gradle守护进程(在gradle.properties文件中添加org.gradle.daemon=true)
2.开启gradle并行构建(在gradle.properties文件中添加org.gradle.parallel=true)
3.使用最新版本的gradle
4.不要使用动态的项目依赖(compile 'com.android.support:appcompat-v7:21.+')
5.不要在gradle配置阶段做耗时的操作
6.开启gradle按需配置(在gradle.properties文件中添加org.gradle.configureondemand=true)
eg:gradle assembleDebug --dry-run --profile --no-deamon
原文链接:https://medium.com/@shelajev/6-tips-to-speed-up-your-gradle-build-3d98791d3df9#.ilbylyt36