在 SO 上有更多类似的问题,但我没有找到任何答案,所以我打开了新问题。
我正在使用:
Android Studio 2.2.3(但与 2.2.2 相同) Gradle 2.14.1 JRE 1.8.0
我在 Mac 上使用它,OS X El Capitan(2.5 GHz,i5,8GB RAM)。
直到几周前它一直运行良好,现在它变得非常缓慢。大多数时候是“索引/更新索引”。
我并不关心构建时间(大约需要 30-40 秒,但我可以忍受),而是担心持续索引导致编码几乎不可能(整体响应能力很差)。
我的 gradle 文件中是否有任何可能导致此问题的内容?
我确实有一些依赖,但应用程序本身相对简单。
build.gradle//应用程序
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//项目
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
}
附: 我已启用 - 离线工作、并行和守护进程。我增加了 VM 堆大小。我已经上传到最新的 Android Studio。我已经用 jcenter() 替换了 maven。 我有什么遗漏吗?
最佳答案
我也遇到过这种情况,我只是Sync 'app'就解决了...
或者使用这个
使缓存失效/在“文件菜单”下重新启动
关于java - Android Studio 变得非常缓慢并且不断出现 "updating indices",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41022764/