Gradle doens't work offline in Android Studio 2021.2.1

823 views Asked by At

I'm trying to use Android Studio offline because in the place I work, IT policy doesn't allow me to download .jar or .zip or some similar files though I can request the files which I want to download from IT team. I tried to create a hello world project offline but gradle didn't synchronised so I couldn't even run a simple project. Here are the things I tried for running android studio offline;

  • I downloaded gradle version 7.2 complete build from official website,

  • Specified Gradle location using the menu File --> Settings --> Build, .. --> Gradle,

  • Choose version 7.2. for both Android Gradle plugin and Gradle versions in File --> Project Structure --> Project menu.

  • Added the zip of gradle version 7.2 to gradle-wrapper.properties as;

...
distributionUrl=file\:/gradle-7.2-all.zip
...

At the end of all of the steps above, I still get connection errors.

Here is the error I got;

Could not resolve all artifacts for configuration ':classpath'.
Could not download gradle-7.2.0.jar (com.android.tools.build:gradle:7.2.0): No cached version available for offline mode

... (around 80 more jar files)

Possible solution:
Disable offline mode and rerun the build

It's third day and I couldn't even started to write a line of code. Could you please help me out?

0

There are 0 answers