有啥办法能加快Android Studio中Gradle build速度
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了有啥办法能加快Android Studio中Gradle build速度相关的知识,希望对你有一定的参考价值。
参考技术A 开启gradle单独的守护进程在下面的目录下面创建gradle.properties文件:
/home/<username>/.gradle/ (Linux)
/Users/<username>/.gradle/ (Mac)
C:\Users\<username>\.gradle (Windows)
并在文件中增加:
org.gradle.daemon=true
同时修改项目下的gradle.properties文件也可以优化:
# Project-wide Gradle settings.
# IDE (e.g. android Studio) users:
# Settings specified in this file will override any Gradle settings
# configured through the IDE.
# For more details on how to configure your build environment visit
#
# The Gradle daemon aims to improve the startup and execution time of Gradle.
# When set to true the Gradle daemon is to run the build.
# TODO: disable daemon on CI, since builds should be clean and reliable on servers
org.gradle.daemon=true
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
#
org.gradle.parallel=true
# Enables new incubating mode that makes Gradle selective when configuring projects.
# Only relevant projects are configured which results in faster builds for large multi-projects.
#
以上是关于有啥办法能加快Android Studio中Gradle build速度的主要内容,如果未能解决你的问题,请参考以下文章
有啥办法可以在 Mac 上的 android studio 3.5.1 中修复这个错误
android studio更新gradle失败的解决办法-转
工作用的网站是https打头的,打开特别慢,一般常用网站打开就很快,有啥办法能加快这个网站的打开速度么
Android Studio 中的“要求 Wifi 权限限制了仅支持以太网的电视上的应用程序可用性”警告 - 对此有啥办法吗?