0

I'm running my Android Studio on my

sony vaio 
AMD E-450 APU with Radeon(tm) HD graphics 1.65 ghz
and 8 gb Ram 

and is installed on HDD(not that good) but the android studio is very slow and gradle build took about 5 min until the project runs and sometimes gradle build repeats another time this is really a catastrophy!! so what is the problem in my computer? and if I replace my HDD by SSD will that be good and android studio will run just in few seconds ! help me please and thanks in advance :)

PriyankaChauhan
  • 953
  • 11
  • 26
André Abboud
  • 1,864
  • 2
  • 14
  • 23
  • 1
    aside from SSD, try the suggestions from here: http://stackoverflow.com/questions/30817871/android-studio-is-too-slow – user1506104 Sep 28 '16 at 06:05

1 Answers1

3

Replacing drive won't help much as the problem lies within gradle build process which takes huge time to rebuild project every time you run it.

Here is the link to update your gradle settings for faster build processing :

https://medium.com/@101/speed-up-gradle-build-in-android-studio-80a5f74ac9ed#.x2w5e5efk

In case link is dead, here are some steps to speed up your gradle process:

Step 1: Update Gradle version

NOTE:You should use updated gradle version for above two steps

  • Copy above file to AndroidStudio/gradle folder
  • Last step is to add your distribution in Android Studio Settings > Gradle (Use local gradle distribution and set it to above pasted zip file)

Step 2: Enable Offline mode, Gradle daemon and parallel build for the project

  • Go to Gradle from android studio Setting and click in Offline work box.
  • Go to Compiler from android studio Setting and add “— offline” in command-line box and click Compile independent modules in parallel.

Step 3: The next step is to enable the Gradle daemon and parallel build for your project

  • Add following lines to gradle.properties file:

    org.gradle.parallel=true

    org.gradle.daemon=true

  • Increase the max heap size in case you have a large project (gradle.properties file):

org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

Step 4: Tweek Memory settings

  • In your module’s build file, add:

    dexOptions {

    jumboMode = true
    
    javaMaxHeapSize "4g"
    

    }

Here 4g is 4 GB of memory.

Hope it helps.

Deepak Singh
  • 114
  • 6
  • 1
    Creating link only answers is bad practice. The site you reference could be deleted or modified anytime which could make your answer useless or even wrong. You for sure should link the original article, but you also have to include all necessary information to solve the problem with the answer itself. – t.niese Sep 28 '16 at 06:03
  • @t.niese I wasn't even thinking of posting it as an answer. I was missing enough reputation to comment, that's why i posted this link as an answer. BTW thanks for reminding that i should add all the info. myself to keep the answer long lived. Edited the answer. – Deepak Singh Sep 28 '16 at 06:49