我使用 Android Studio 来构建我的 Android 应用程序。但我的笔记本电脑需要 5 分钟才能构建应用程序。我不知道为什么。构建 gradle 的加载速度总是太慢。这是我的代码构建 Gradle:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
repositories { mavenCentral() }
defaultConfig {
applicationId "thsoft.com.sosme"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
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.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.google.android.gms:play-services:8.1.0'
compile 'com.wang.avi:library:1.0.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.jakewharton:disklrucache:2.0.2'
compile 'com.squareup.retrofit:retrofit:2.0.0-beta2'
compile 'com.squareup.okhttp:okhttp:2.5.0'
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'com.crittercism:crittercism-android-agent:5.5.0-rc-1'
}
你能帮我解决一下吗?谢谢!
最佳答案
gradle 代码没有任何问题,但是依赖项太多。这取决于您的处理器的速度和内存。尝试使用 8GB 内存就可以了。根据官方网站,最低要求是 4GB!!
关于android - 构建 Gradle Android studio 构建缓慢,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33886609/