Essential requirements for Android developers Part 02 — gradle offline

Farhad Sanaei
2 min readSep 4, 2020

--

There were a lot of times that I was complaining about the build time. I am sure that you also did it a looooot :)

What I figured out is that in some cases, every time that we make a build, gradle is trying to fetch all the libraries again! That would be so time-consuming for us.

How can we resolve it? What is the solution? We can cache them and turn gradle to offline!

To do that, you need to make one successful build first. Then you click the offline toggle from the gradle window on the right side of your IDE as it showed in the following image.

Gradle offline toggle in Android Studio

After that every time that you make a build it will use cached libraries instead of fetching everything again.

Please be aware that you might need to turn it off only when you make a change in the versions of the libraries that you are using. But again after a successful build, you can turn it on to prevent fetching external libraries 😊

I hope you enjoyed it and finds it useful. I will keep this series up to date and will add more tricks.

If you find this useful please subscribe and 👏

Happy coding 🤓

--

--