Estava com o mesmo problema, então resolvi ajudar, para aumentar a velocidade de Build do Gradle, modifique as suas configurações e scripts da seguinte maneira:
1 - Clique em File > Settings > Gradle > e Modifique como está abaixo:

- Selecione a opção Offline work e clique OK
2 - Clique em File > Settings > Compiler > e Modifique como está abaixo:

- Selecione as quatro opções acima "Compile, Make, Sync, Configure" e coloque em
Command-line Options: --offline
e clique OK
3 - modifique o seguinte script build.gradle(Module:app) - adicione dexOptions:
apply plugin: 'com.android.application'
android {
...
}
dexOptions {
javaMaxHeapSize "4g" //specify the heap size for the dex process
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
}
Adicione este trecho:
dexOptions {
javaMaxHeapSize "4g" //specify the heap size for the dex process
}
4 - modifique o seguinte script gradle.properties(Project Properties):
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.daemon=true
org.gradle.parallel=true
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
Adicione este trecho:
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.daemon=true
org.gradle.parallel=true
Se aparecer algum aviso lá em cima, clique em Try Again...
ou Sync Now
, e veja o resultado.
Dica: Caso seu Android Studio estiver demorando muito para iniciar, recomendo também ver este post sobre como aumentar a memoria da IDE.
Espero ter ajudado. comigo funcionou, o Gradle está mais rápido.