Android Studio running, compiling a dead-end solution

Source: Internet
Author: User

Android Stuido as Google's main push IDE, with Gradle compilation, there are many advantages and convenience. The only use of the process of uncomfortable place is puzzling, often in the Gradle build when the card is forced to restart the computer, very silent, my machine is 8G memory new machine also did not open other programs. In short, it is very slow to compile and sometimes it often dies. Tried a lot of optimization scheme, the number of cards die less compilation is also a lot faster. Share my findings with you.

increase running memory and optimize compilation

Take PC-side for example, Mac is similar

1. Request Large Memory

Installation Path\studio64.exe.vmoptions or Studio.exe.vmoptions

Open with a text editor and find the starting two lines, as follows

-xms128m
-xmx750m

Modify minimum and maximum values, recommended for

-xms256m
-xmx2048m

2 Optimizing compilation

A:

File->setting->compile

Tick other options except for the second item and fill in the VM options:

-xmx2048m-xx:maxpermsize=512m-xx:+heapdumponoutofmemoryerror-dfile.encoding=utf-8

B:

C:\Users\yourname\.gradle

Open the gradle.properties with a text editor, and edit the following:

Org.gradle.daemon=true
Org.gradle.jvmargs=-xmx2048m-xx:maxpermsize=512m-xx:+heapdumponoutofmemoryerror-dfile.encoding=utf-8
Org.gradle.parallel=true
Org.gradle.configureondemand=true

Set in setting

At the same time in Android studio total settings, such as:

1.offline work Tick

2.updates inside a few hooks to remove

Android Studio running, compiling a dead-end solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.