My Windows 7 machine has a quad core i7 processor. When I Rebuild my project, it takes on average 25 seconds. And when I launch the app, it takes on average 36 seconds (before
In addition to optimizations specific to Gradle (see below), I recommend that you try disabling anti-virus protection for your Gradle caches directory and your Android Studio project directory. For me, this reduces my build times by roughly 50%. Excluding those same directories from Windows Search indexing can also help.
Gradle optimizations I use, in ~/.gradle/gradle.properties.
org.gradle.daemon=true
org.gradle.jvmargs=-Xmx6144m <-- Tweak this based on available RAM
org.gradle.caching=true
org.gradle.parallel=true
kotlin.incremental=true
Note that enabling caching means you sometimes have to explicitly clear your caches when switching branches. I run this script when I run into puzzling build issues.
#!/bin/bash
# Clean Android cache
./gradlew cleanBuildCache
# Clean Gradle cache, prompting for each directory
find ~/.gradle/caches -maxdepth 1 -name build-cache* -print -exec rm -rfI {} \;
# Clean Project
./gradlew clean
# Stop Gradle Daemon
./gradlew --stop