There are more similar question on the SO, but I haven't found my answer on any of them so I am opening new one.
I am using:
Android Studio 2.2.3 (but was same with the 2.2.2) Gradle 2.14.1 JRE 1.8.0
I am using it on the mac, OS X El Capitan (2.5 GHz, i5, 8GB RAM).
It has been working great until few weeks ago, and now it is so painfully slow. Most of the time it is "indexing/updating indices".
I am not that concerned about build time (it takes about 30-40sec, but I can live with that) as much as that constant indexing that makes coding almost impossible (overall responsiveness is pretty poor).
Is there anything in my gradle files that could cause this?
I do have some dependencies, but the app itself is relatively simple.
build.gradle //app
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
dataBinding {
enabled = true
}
defaultConfig {
applicationId "com.example.myproduct"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.+'
compile 'com.android.support:support-v4:23.2.+'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.android.support:design:23.2.+'
compile 'com.jakewharton.threetenabp:threetenabp:1.0.4'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'io.reactivex:rxjava:1.0.10'
compile 'io.reactivex:rxandroid:1.1.0'
compile 'com.google.android.gms:play-services-auth:8.3.0'
compile 'com.facebook.android:facebook-android-sdk:4.16.1'
}
build.gradle//project
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:1.5.0-beta2'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
P.S. I have enabled - offline work, parallel and daemon. I have increased VM heap size. I have uploaded to latest Android Studio. I have replaces maven with jcenter(). Is there anything I am missing?
According to Android Studio's official system requirements, it takes at minimum 3 GB RAM to run smoothly. Honestly, its a lot and I believe that is the biggest cause of being it too slow all the time. The android developers are always complaining about the speed of Android Studio and how its slow ALL THE TIME.
Since Android Studio, by default, runs a Gradle build when you start up, it manifests as an extremely slow start-up. The problem is extremely easy to check for: While you are experiencing the symptoms of a slow Android Studio, press Ctrl - Alt - Delete and open Windows Task Manager.
It also happened to me,I just Sync 'app' and it was solved...
Or use this
Invalidate Caches / Restart under "File Menu"
For the others having the same problem:
My android studio returned back to its original performance (which was ok). It is hard to me to say what made an improvement because I have done lots of changes at once, here are few I recall:
some of it I have tried before asking this question, but I think all came back to normal when I did last update to Android studio 2.2.3
Also, you can try:
Files -> Invalidate Caches / Restart...
This worked for me.
Try to store Sdk on other drive and also try to invalidate cache and restart. Hope this helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With