4

Android studio is building very slowly after adding Android Design Support library in gradle

compile 'com.android.support:design:22.2.0'

but builds fast once I remove the above library, 30 seconds against 5 minutes, I am using TabLayout and Toolbar from the library hence I need it, not sure if its the library issue or the TabLayout itself taking time to load,

Is there a way I can speed up the build process by any means ?

Update: The actual reason was the company firewall, though proxy is set it takes lot of time to validate each incoming file and cause huge delay,so accepted answer should work to avoid frequent calls

Ujju
  • 2,723
  • 3
  • 25
  • 35
  • Try to [exclude](http://stackoverflow.com/questions/20071671/exclude-jar-from-compile-in-android-studio-with-gradle) some unnecessary modules from design lib. – Slonorib Sep 22 '15 at 10:51
  • I've never had this issue but have you tried version 23.0.1? – gaara87 Sep 22 '15 at 15:02
  • Tried it doesn't work well either had resource missing error , also it's not the official library given in dev site – Ujju Sep 22 '15 at 16:51

1 Answers1

6

After you synchronize gradle you can enable offline Gradle synchronization in Android Settings.

To do that open the Android Studio Settings and then open

Build, Execution, Deployment > Build Tool > Gradle

and check Offline work checkbox in Global Gradle settings.

Now gradle will gets project dependecies from local cache

markView
  • 333
  • 1
  • 7
  • Did the trick, though I vud ve preferred working in online mode, else everytime I add new lib I shud change in settings and revert back after synching, – Ujju Sep 22 '15 at 17:03