美文网首页
Android Studio Gradle 缓存文件夹设置

Android Studio Gradle 缓存文件夹设置

作者: zlkwind | 来源:发表于2018-06-06 15:13 被阅读0次

通过Gradle自带参数:

在 Gradle 官方中曾经有一个BUG,就是说Android-Studio无法成功更改缓存的BUG,后来官方给的答案就是采用 Gradle 自己的命令行进行更改。
在Gradle的命令行中有:-g 和 –gradle-user-home 这两个命令的作用一样,你可以通过这两个命令中的一个来进行缓存文件夹的配置:

linux

gradle -g D:/Cache/.gradle -d
gradle --gradle-user-home=D:/Cache/.gradle -d

windows

gradlew -g D:/Cache/.gradle -d
gradlew --gradle-user-home=D:/Cache/.gradle -d

修改.AndroidStudio* 目录

进入到as安装目录下:
D:\program files\Android\Android Studio\bin
找到 idea.properties文件。修改文件:

#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE config 
folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
# idea.config.path=${user.home}/.AndroidStudio/config
idea.config.path=D:/gradleCache/.AndroidStudio/config

#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE system 
folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
# idea.system.path=${user.home}/.AndroidStudio/system
idea.system.path=D:/gradleCache/.AndroidStudio/system

相关文章

网友评论

      本文标题:Android Studio Gradle 缓存文件夹设置

      本文链接:https://www.haomeiwen.com/subject/tnpwxxtx.html