ก่อนที่จะรับข้อมูลเร่งความเร็ว build gradle เราควรรู้ว่า gradle build คืออะไรก่อน eclipse เราไม่มีสคริปต์อัตโนมัติใด ๆ เพื่อสร้าง java และโค้ด XML ไปยัง android apk เพื่อให้เราใช้คำสั่งสร้าง apk เพื่อเพิ่มประสิทธิภาพกระบวนการนี้ gradle build จะเข้ามาในรูปภาพ Gradle เป็นสคริปต์อัตโนมัติในการสร้างและสร้าง apk โดยใช้ android studio
การซิงค์ Gradle คืออะไร
การซิงค์ Gradle เป็นกระบวนการอัตโนมัติในการดาวน์โหลดการพึ่งพาซึ่งประกาศในไฟล์ gradle ตัวอย่างง่ายๆดังแสดงด้านล่าง −

จะเพิ่มความเร็ว Gradle Build ใน Android ได้อย่างไร
ขั้นตอนที่ 1 − เปิด gradle.properties และเพิ่มโค้ดต่อไปนี้ตามที่แสดงด้านล่าง
# Project-wide Gradle settings. # IDE (e.g. Android Studio) users: # Gradle settings configured through the IDE *will override* # any settings specified in this file. # For more details on how to configure your build environment visit # https://www.gradle.org/docs/current/userguide/build_environment.html # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. org.gradle.daemon = true org.gradle.parallel = true org.gradle.configureondemand = true org.gradle.jvmargs=-Djava.awt.headless = true -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 # https://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true
โค้ดด้านบนจะเพิ่ม build JVM MaxPermSize(ให้หน่วยความจำสูงสุด 2GB แก่ JVM complier) และดำเนินการควบคู่กันไป
ขั้นตอนที่ 2 − ตอนนี้ใช้กระบวนการต่อไปนี้เพื่อเพิ่มความเร็ว gradle
ตอนนี้เปิดไฟล์ → การตั้งค่า →สร้าง, Excution, Deployment → Gradle และตรวจสอบงานออฟไลน์ดังที่แสดงด้านล่าง -

เพราะทุกระดับจะซิงค์กับแหล่งข้อมูลทางอินเทอร์เน็ต ดังนั้นเมื่อคุณคลิกงานออฟไลน์ งานก็จะซิงค์กับแหล่งข้อมูลออฟไลน์ด้วย
ขั้นตอนที่ 3 − ตอนนี้ใช้กระบวนการต่อไปนี้เพื่อเพิ่มความเร็ว gradle
ตอนนี้เปิดไฟล์ → การตั้งค่า →สร้าง, Excution, Deployment → complier และทำเครื่องหมายที่ช่องทั้งหมดดังที่แสดงด้านล่าง -
