Saturday, 3 September 2016

How to speed up your Gradle

Create a file named gradle.properties in the following directory:

/home/<username>/.gradle/ (Linux)

/Users/<username>/.gradle/ (Mac)

C:\Users\<username>\.gradle (Windows)


After Create open in notepad and then write following lines :-



org.gradle.parallel=true

org.gradle.daemon=true

org.gradle.jvmargs=-Xmx8192M -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8


Add this line to your build.gradle(Module: app) ->



android{

   ...

dexOptions { javaMaxHeapSize "4g" //specify the heap size for the dex process}

...

}


After this go to setting(Android studio ALT+CTRL+S) - > Theb go to Build,Execution,Deployment -> then Compiler Check all and in command line write  --offline






This will decrease the gradle build time. 

If you have any queries asked me anytime.

Thank you






Few Linux App & commands which is going to used to Build AOSP(Android Open Source Project) Source Code

1. sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32n...