当筵意气临九霄,星离雨散不终朝。这篇文章主要讲述提高Android Studio的Build速度实践相关的知识,希望能为你提供帮助。
1.在下面的目录创建gradle.properties文件
/home/< username> /.gradle/ (Linux) /Users/< username> /.gradle/ (Mac) C:\\Users\\< username> \\.gradle (Windows)
在文件夹中添加
# 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 # http://www.gradle.org/docs/current/userguide/build_environment.html# 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 # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 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. # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:configuration_on_demand org.gradle.configureondemand=true
以上配置的目的: 增大gradle运行的java虚拟机的大小,让gradle在编译的时候使用独立进程,让gradle可以平行的运行。
2. Android studio中配置
开启offline模式
文章图片
文章图片
【提高Android Studio的Build速度实践】
推荐阅读
- 处理application/x-www-form-urlencoded方式接口响应报文中文乱码
- Android获取日期及星期的方法
- Android中的线程
- Objective-C 执行AppleScript脚本
- [Android]异常4-javax.mail.AuthenticationFailedException
- BEGINNING SHAREPOINT&#174; 2013 DEVELOPMENT 第11章节--为Office和SP解决方式开发集成AppsOffice新的App模型
- 导入Cardboard SDK后Build到安卓平台出错(Unable to merge android manifests. (已解决))
- 俄罗斯如何登陆微信? iPhone/安卓 代理服务器使用教程
- Theme.AppCompat.Light.DarkActionBar ActionBarActivity