在Android Studio中减少Gradle同步时间 [英] Reduce Gradle sync time in Android studio
问题描述
我正在使用16GB内存的mac,ssd hdd,并且每次构建,清理或打开项目时,Gradle同步都需要15分钟+,是否有任何Android Studio优化可能会缩短这一时间。 你可能在图书馆使用了一个 +
符号 添加到您的项目(并有一个非常缓慢的互联网连接)。例如: compile'com.android.support:support-v4:+'
这会使每个如果有新版本,sync()gradle将在线检查。如果您更改为特定版本号,例如: compile'com.android.support:support-v4:22.2.0'
然后gradle将使用已经下载到开发机器的缓存版本。
I'm using a mac with 16gb memory, ssd hdd and still Gradle sync takes 15mins+ every time I build, clean or open the project, are there any Android Studio optimisations possible to reduce this time.
You're probably using a +
symbol on the libraries you added to your project (and have a very slow internet connection). For example: compile 'com.android.support:support-v4:+'
This will make on every sync() gradle will check online if there's a new version. If you change to specific version number, for example: compile 'com.android.support:support-v4:22.2.0'
Then gradle will use the cached version that already been downloaded to your development machine.
这篇关于在Android Studio中减少Gradle同步时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!