Android Studio Gradle Build Slow

Share
Ongoing Windows, macOS, Linux Updated November 13, 2026Based on 4 user reportsHow we research

Quick answer

Slow Gradle builds are usually memory, configuration or cache problems. Raise org.gradle.jvmargs, enable the configuration cache, use KSP instead of kapt and run Build Analyzer to find the bottleneck.

Most likely fix: Run Build Analyzer

How to fix it

Try these in order — the most common fix is first.

  1. 1. Run Build Analyzer

    1. View > Tool Windows > Build, then open the Build Analyzer tab
    2. If garbage collection takes over 15% of build time, raise the heap
    Did this fix it?
  2. 2. Raise the Gradle heap

    1. In gradle.properties set org.gradle.jvmargs=-Xmx6g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g
    2. Google recommends explicit MaxMetaspaceSize because of Gradle issue 19750
    3. Measure before and after
    Did this fix it?
  3. 3. Enable the configuration cache

    1. Add org.gradle.configuration-cache=true to gradle.properties
    2. Use Build Analyzer to check plugin compatibility first
    Did this fix it?
  4. 4. Cut unnecessary work

    1. Migrate from kapt to KSP where libraries support it
    2. Use static dependency versions (no '+')
    3. Set android.enableJetifier=false if no old support libraries remain
    4. Keep AGP and Android Studio up to date
    Did this fix it?
  5. 5. Windows antivirus exclusions

    1. Exclude the .gradle folder, project folder and SDK folder from real-time scanning
    Did this fix it?

Symptoms

Builds take minutes, sync is slow, or Gradle runs out of memory with 'Daemon disappeared' or 'GC overhead' errors.

Why it happens

  • Gradle heap too small, so garbage collection dominates the build
  • Configuration cache and build cache off
  • kapt in use instead of KSP
  • Dynamic dependency versions that force update checks
  • Antivirus scanning build output (Windows)
  • Jetifier still enabled

This guide also covers

  • android studio gradle build slow
  • speed up gradle build android
  • gradle build taking forever android studio
  • gradle daemon disappeared android studio

Still not working?

If Android Studio keeps failing, you're not alone. See every Android Studio problem users report or the alternatives people switch to.

Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.

Talk to us
Fixed it? Share this guide

Other Android Studio errors

All 11 Android Studio errors and fixes →