Home > database >  Is there a way to prevent Android Studio or Intellij IDEA from downloading older version of gradle o
Is there a way to prevent Android Studio or Intellij IDEA from downloading older version of gradle o

Time:02-10

I have the latest version of gradle (7.4) installed on my machine, every time I open a new project on Android Studio or Intellij to write Kotlin codes, it starts downloading old versions of gradle, is there a way to stop it or to run AS/IDEA offline ?

CodePudding user response:

You can modify the distributionUrl property in the gradle-wrapper.properties file to point to a local file. So download a single copy of the necessary Gradle version from https://services.gradle.org/distributions/. Then before you open a project in the IDE, edit its gradle-wrapper.properties file to point to this local copy. It will copy the local file instead of downloading it.

For example, change

distributionUrl=“http\://services.gradle.org/distributions/gradle-3.3-bin.zip”

to

distributionUrl=file\:///C:/gradle-7.4-all.zip

I found a post about doing this here.

  • Related