Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> java.lang.OutOfMemoryError: GC overhead limit exceeded
尝试过:
dexOptions {
javaMaxHeapSize "4g"
}
这似乎是网上唯一可用的解决方案。
但在第二次构建时仍然超出了限制,除非我杀掉Studio任务并重新启动,这样才能第一次工作。
build.gradle 中肯定没有太多依赖项。
build.grade
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.xxxxx.android"
minSdkVersion 16
targetSdkVersion 23
versionCode 8
versionName "1.3"
}
dexOptions {
javaMaxHeapSize "4g"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.jakewharton:butterknife:6.1.0'
compile 'com.squareup.okhttp:okhttp:2.3.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.3.0'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'com.google.android.gms:play-services-location:+'
}
build.gradle
文件吗? - IlyaGulya