22
Android Studio 3.2 Canary 5
Build #AI-173.4630681, built on March 3, 2018
JRE: 1.8.0_152-release-1136-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.15.4-300.fc27.x86_64

I have just started a new project and when I sync'd I got this dialog box.

enter image description here

I am just wondering what is the difference between the Android Gradle Project and Gradle.

How would I upgrade to Gradle to version 4.5?
What is the purpose of both of these?

Many thanks in advance

ant2009
  • 29,065
  • 146
  • 383
  • 576

3 Answers3

39

Gradle is the build system.

You can use it with a lot of plugins. One of these is the Android Gradle plugin.
It is used to provide processes and configurable settings that are specific to building and testing Android applications.

Gabriele Mariotti
  • 250,295
  • 77
  • 670
  • 690
  • 11
    Upvoting for clearing a common misconception: the Android Gradle Plugin is a plugin for Gradle which allows you to build Android applications, not a plugin for Android Studio which allows you to use Gradle. – user2891462 Sep 08 '20 at 15:43
17

Even if you have written the same java source code for a java project and android project, the way they are built and executed completely differs from each other.
Java project sources compiles to byte codes (.class files) and runs on JVM (java virtual machine). Android project sources compiles to Dalvik byte codes (.dex files) and runs on DVM (Dalvik Virtual Machine). And both of these virtual machine have different ways of executing commands.

Android projects have many platform specific steps when building application that standard Java applications does not have. (like packaging as apk, automatic signing, project flavors management, minimum API level) With the addition of Android Gradle plugin these differences can be applied more easily and in a more refined way. (So building Android apps becomes easier for everyone).

miskender
  • 6,867
  • 1
  • 17
  • 22
8

The Android Studio build system is based on Gradle, and the Android plugin for Gradle adds several features that are specific to building Android apps. Although the Android plugin is typically updated in lock-step with Android Studio, the plugin (and the rest of the Gradle system) can run independent of Android Studio and be updated separately.

From the Docs

https://developer.android.com/studio/releases/gradle-plugin.html

MarGin
  • 1,780
  • 1
  • 15
  • 25
  • 1
    Only to be more complete: in Doc(above link) there is a table that specified which version of Gradle is required for each version of the Android Gradle plugin. – Reyhane Farshbaf Nov 17 '20 at 09:55