why does intellij have to install a different gradle version for each android project i make

Viewed 2053

Gradle is just a build system, right? Why does intellij want to download gradle 2.3 when I have the latest gradle version locally installed. If i setup intellij to use the local distribution, the build fails with an error saying no cached version of gradle 4.3 is available for offline mode.

1 Answers

Point #1, You can point Intellij to a gradle installation. See Intellij Gradle docs that describes your options, but pay special attention to the next point, which intellij also supports.

Point #2 Build systems also have versions. Gradle is constantly being updated, so building with the wrong version of Gradle can fail.

That is why a gradle script can specify the version that it needs in order to build. This is essentially a bootstrapping process designed to make your build scripts essentially self sufficient. See for example Gradle docs that describe this practice.

Related