Why does Android Studio download gradle every time I try to import a new project?
Initially, I imported one gradle project for which Gradle 2.1 was auto-downloaded. Subsequently, for a second project import, it downloaded Gradle 1.10. Now again while importing a third project, it has downloaded Gradle 2.2.1.
What is happening?
Android Studio uses Gradle, an advanced build toolkit, to automate and manage the build process, while allowing you to define flexible custom build configurations. Each build configuration can define its own set of code and resources, while reusing the parts common to all versions of your app.
Enable offline mode in Android Studio to disable checking for updates everytime. Go to Settings>Compiler>Gradle>Offline mode. If this is enabled the gradle will be told not to connect to internet and check for updates.
Open your gradle. properties file in Android Studio. Restart Android Studio for your changes to take effect. Click Sync Project with Gradle Files to sync your project.
Android Studio comes with a working installation of Gradle, so you don't need to install Gradle separately in that case. In order to create a new build or add a Wrapper to an existing build, you will need to install Gradle according to these instructions.
Projects can declare which Gradle they require to run (see gradle.properties
file in gradle
directory in the root of the project).
Android Studio uses this information to download and run the right version (it's actually not Android Studio, it's the Gradle Wrapper running inside it). And it's a good thing.
What you can do?
~/.gradle
directory, it will be used for any project declaring the same version. It's one-time cache.Same happens to me.
The answer of JBaruch is allright.
1.- When you're opening a file on the option Gradle project: select the build.gradle that cames on your project
2.- Select the option "Use local grade distribution" and in Gradle home option; go and select in C:\Program Files\Android\Android Studio\gradle\gradle-2.2.1
It will not ask you to download it again (except if needs other version)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With