android studio构建项目一直卡在gradle build running界面
来源:互联网 发布:checking php support 编辑:程序博客网 时间:2024/05/17 08:47
来源这里
http://stackoverflow.com/questions/16775197/building-and-running-app-via-gradle-and-android-studio-is-slower-than-via-eclips
1.
(创建一个文件名叫gradle.properties,放在对应一下的目录)
Create a file named gradle.properties in whatever directory applies:
/home/<username>/.gradle/ (linux)
/Users/<username>/.gradle/ (Mac)
C:\Users\<username>\.gradle (Windows)
org.gradle.daemon=true
2.
IDE Settings
3.
你可以忽略Gradle更新(勾选)
You can ignore gradle update-to-date checks.
原文如下:
Configuration File
Create a file named gradle.properties
in whatever directory applies:
/home/<username>/.gradle/
(Linux)/Users/<username>/.gradle/
(Mac)C:\Users\<username>\.gradle
(Windows)
Append:
org.gradle.daemon=true
Ensure you are using the latest development versions.
Command Line Arguments
The --daemon --parallel --offline
command line arguments for Gradle builds work great. Learn about these options from the documentation.
Overview
An optimized Gradle properties file (gradle.properties
) includes:
# 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 serversorg.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=256morg.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_projectsorg.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_demandorg.gradle.configureondemand=true
Gradle properties works local if you place them at projectRoot\gradle.properties
and globally if you place them at user_home\.gradle\gradle.properties
. Properties applied if you run gradle tasks from console or directly from idea:
IDE Settings
Or enable gradle properties from the IDE settings
Dependencies
Prefer @aar
dependencies over library projects.
Search aar package on mavenCentral (http://gradleplease.appspot.com/), github (https://github.com/Goddchen/mvn-repo), or build it manually from sources and put into libs folder. If you are not editing sources of the dependency library you should not build it every time with your project sources.
Antivirus
Consider to exclude project and cache files from antivirus scanning. This is obviously a trade off with security (don't try this at home!). But if you switch between branches a lot, then antivirus will rescan files before allowing gradle process to use it, which slows build time (in particular AndroidStudio sync project with gradle files and indexing tasks). Measure build time and process CPU with and without antivirus enabled to see if it is related.
Warning
Don't use auto-import feature (yet) due to known bug which will slow down the IDE.
Fabric Crashlytics
Fabric has typo at the documentation pointing to the private maven repo which needs authorization.http://stackoverflow.com/a/27130652/624706
More Reading
An article on Gradle describes a few settings to increase its speed.
- android studio 构建项目一直卡在gradle build running
- android studio 构建项目一直卡在gradle build running
- Android Studio 构建项目一直卡在gradle build running
- android studio 构建项目一直卡在gradle build running
- android studio构建项目一直卡在gradle build running界面
- android studio一直卡在gradle build running界面
- Android Studio 构建项目一直卡在 gradle build running 解决方法
- 解决android studio 构建项目一直卡在gradle build running
- Android Studio 构建项目卡在 gradle build running
- android studio 一直卡在Gradle:Build Running的解决办法
- android studio 一直卡在Gradle:Build Running的解决办法
- Android Studio 一直卡在Gradle:Build Running的解决办法
- android studio 一直卡在Gradle:Build Running的解决办法
- Android studio一直卡在Gradle:Build Running的解决方法
- 【Android】android studio 一直卡在Gradle:Build Running的解决办法
- Android Studio运行项目一直卡在build gradle runing 的解决方法。
- Android studio 构建项目时一直卡在building gradle的完美解决方案
- Android Studio 一直卡在Building Gradle project的界面
- 寻址方式
- hdoj2571【DP基础】
- Unity让调试更加简单(一)
- [MySQL学习笔记]case when then else end用法
- 练习1-22 编写一个程序,把较长的输入行“折”成短一些的两行或多行,折行的位置在输入行的第n列之前的最后一个空格之后
- android studio构建项目一直卡在gradle build running界面
- char字符与wchar_t字符的相互转换,以及wchar_t字符串的常用用法
- 古典小说网 首创卡拉OK式阅读新体验
- SAP本地化-银企直连
- solver.prototxt参数说明(三)
- hdu_2955_Robberies(01背包)
- 用Workbench迁移MySQL小数据库
- 定制bootstrap的按钮btn-primary
- cassandra 监控方案评估