首先,用AS,你必须fanqiang,其它都是次要的。

AS/bin/*.exe.vmoptions

#
# *DO NOT* modify this file directly. If there is a value that you would like to override,
# please add it to your user specific configuration file.
#
# See http://tools.android.com/tech-docs/configuration
#
-Xms256m
-Xmx2048m
-XX:MaxPermSize=512m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-da
-Djna.nosys=true
-Djna.boot.library.path=

-Djna.debug_load=true
-Djna.debug_load.jna=true
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-XX:+HeapDumpOnOutOfMemoryError
-Didea.paths.selector=AndroidStudio2.1
-Didea.platform.prefix=AndroidStudio

其次,用户/.gradle/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
# 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
# Project-wide Gradle settings.

再次,

最后,至于很多文章说要打开gradle的离线模式,这里我想根据使用经验说一下,首先做android,你得fq,我并不建议不熟悉gradle的人直接将该模式打开,这是其一,其二使用AS时,一定记得把杀毒软件或者防火墙关闭了,某数字卫士和动物卫士经常导致我编译假死,当时我还来回重装,来回设置。

Android Studio编译卡死的更多相关文章

  1. android studio 编译加速

    1. http://www.52codes.net/article/658.html 2.http://my.oschina.net/sammy1990/blog/388846 3.http://st ...

  2. 手把手图文并茂教你用Android Studio编译FFmpeg库并移植

    转载请把头部出处链接和尾部二维码一起转载,本文出自逆流的鱼yuiop:http://blog.csdn.net/hejjunlin/article/details/52661331 之前曾写过一篇&l ...

  3. Android studio 编译失败Error:Could not read entry ':app:processDebugManifest' from cache taskArtifacts.b

    Android studio 编译失败 Error:Could not read entry ':app:processDebugManifest' from cache taskArtifacts. ...

  4. 【Android】Android studio 编译问题:finished with non-zero exit value 2

    1.Android studio 编译问题:finished with non-zero exit value 2 问题: Error:Execution failed for task ':andr ...

  5. 我的Android进阶之旅------>解决Android Studio编译后安装apk报错:The APK file does not exist on disk

    1.错误描述 今天用Android Studio编译应用后安装APK的时候,报错了,错误如下所示: The APK file build\outputs\apk\OYP_2.3.4_I2Base_64 ...

  6. Android Studio编译慢、卡死和狂占内存怎么破?

    https://www.zhihu.com/question/27953288 作者:知乎用户链接:https://www.zhihu.com/question/27953288/answer/118 ...

  7. 基于android studio编译工具下的android开发之IBeacon 例子

    想直接看主要内容的请调到红字下面. 之所以会接触到android下的IBeacon,是因为我自己导师给的任务.一个网址http://estimote.com/和一句话:看看这个网站,然后试下在安卓手机 ...

  8. eclipse 和 android studio 编译时报 Unsupported major.minor version 52.0错解决办法

    version 52.0 是java8的环境.当gradle tools 升级到2.2.1时候,可能编译时候会报该错误. 很多网友说更改java version,但是很多时候无效.下面是我遇到时候的解 ...

  9. windows android studio 编译Jni动态库

    项目需要,折腾了半天搞定windows android studio环境编译Jni动态库,现记录下来. 准备安装环境: 1. android studio 下载地址是http://www.androi ...

随机推荐

  1. mkdir(): Permission denied

    记录下,凡是遇到此类问题都是无权限导致. 根据不同场景,需要在不同的文件夹设置不同的权限. 例如,图片相关, 在php中,首先看下 配置php.ini的文件上传是否开启(file_uploads = ...

  2. xml转换为json格式时,如何将指定节点转换成数组 Json.NET

    使用Json.NET转换xml成json时,如果xml只有单个节点,但json要求是数组形式[], JsonConvert.SerializeXmlNode 并不能自动识别 示例如下: RecordA ...

  3. [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [E:\soft\studySoft\tomcat\apache-tomcat-8.5.33\webapp

    问题 启动tomcat,就一直卡在了这里 继续往上查看日志 解决方法:

  4. js重点--原型链

    通过将一个构造函数的原型对象指向父类的实例,就可以调用父类中的实例属性及父类的原型对象属性,实现继承. function animals(){ this.type = "animals&qu ...

  5. js根据毫米/厘米算像素px

    <html><meta http-equiv="content-type" content="text/html;charset=utf-8" ...

  6. ubuntu18系统美化

    1. 将选定的背景图片 login-bg.jpg 移动到 /usr/share/backgrounds/ 目录下 sudo mv currentdir/mypicture.jpg /usr/share ...

  7. JS通用模块模式 UMD

    历史 JS诞生之初面向简单页面开发, 没有模块的概念. 后来页面逐渐复杂, 人类构造到 IIFE 立即执行函数来模拟 模块: 之前也有雅虎的实践,使用命名空间 作为模块名. 最后衍生出 面向各种使用场 ...

  8. Python核心编程笔记 第二章

    2.1   程序输出:print语句         可以使用print语句显示变量的字符串表示,或者仅用变量名查看该变量的原始值. 2.2   程序输出和raw_input()内建函数       ...

  9. 多个Fragment在一个activity中通过按钮的展示方法

    fragment使用方法 1. 创建主Mainactivity extends AppCompatActivity 2. Oncreate & setContentView 3. 完成XML的 ...

  10. Python:匿名函数lambda的函数用法和排序用法

    一.介绍: Lambda函数,是一个匿名函数,创建语法: lambda parameters:express parameters:可选,如果提供,通常是逗号分隔的变量表达式形式,即位置参数. exp ...