Speed up Android Studio compilation Speed ZZ

Source: Internet
Author: User

Project build once too slow through various search integrations the following is for reference only

1. Create a new Gradle.properties file in the following directory

/home//.gradle/(Linux)

/users//.gradle/(MAC)

C:\Users\\.gradle (Windows)

Add in File

Org.gradle.daemon=true

2, in the Local project Gradle.properties add the following

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

Org.gradle.parallel=true

Org.gradle.configureondemand=true

Org.gradle.daemon=true

You can also set the global properties as above so the project will follow this setting

3, open File-setting-build-compiler for the following settings!

Open File-setting-build-buildtool for the following settings

Set to offline here and apply local Gradle speed up compilation

4. Open File-project Structure

Set version of Gradle

5. Under your app Gradle, add the following

dexoptions {

Incremental =true

Javamaxheapsize "4g"//here can be configured according to the computer itself the larger the value of course the faster

Predexlibraries = False

}

6, in addition, due to domestic visits to foreign servers slow caused as and card and slow, so try to use Jar arr and other ways to reduce direct compile

*.jar: Contains only the class file and the manifest file, does not contain the resource file, the slice and so on all res files.

*.aar: Contains all resources, class, and res resource files all contain

If you are just a simple class library then use the generated *.jar file;

If you have a UI library that contains resource files such as control layout files and fonts, you can only use the *.aar file.

Speed up Android Studio compilation Speed ZZ

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.