How to make Android Cordova project built with Gradle build offline?
<p>I have a Ionic/Cordova project, builds for Android are done with Gradle.</p>

<p>I installed all necessary Android SDKs and the project was building fine for many months, but today it fails with the following error:</p>

<pre><code>Running: d:\git\myproject\platforms\android\gradlew cdvBuildDebug -b d:\git\myproject\platforms\android\build.gradle -Dorg.gradle.daemon=true

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
&gt; Could not resolve all dependencies for configuration ':classpath'.
   &gt; Could not resolve com.android.tools.build:gradle:1.0.0+.
     Required by:

BUILD FAILED

Total time: 26.792 secs
         :android:unspecified
      &gt; Failed to list versions for com.android.tools.build:gradle.
         &gt; Unable to load Maven meta-data from https://repo1.maven.org/maven2/com/android/tools/build/gradle/maven-metadata.xml.
            &gt; Could not GET 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/maven-metadata.xml'.
               &gt; Connection to https://repo1.maven.org refused

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

d:\git\myproject\platforms\android\cordova\node_modules\q\q.js:126
                    throw e;
                    ^
Error code 1 for command: cmd with args: /s /c "d:\git\myproject\platforms\android\gradlew cdvBuildDebug -b d:\git\myproject\platforms\android\build.gradle -Dorg.gradle.daemon=true"
Error: cmd: Command failed with exit code 1
Cordova command failed with error code 1, aborting!
</code></pre>

<p><em>Clearly, since the project was building just fine for months, everything needed to have it build is already on disk, but the build is probably checking if there are updated version of artifacts in the Maven repo, and this is failing.</em></p>

<p>This is not a very desired behavior sometimes.</p>

<p>Is it possible to configure the build to always build offline?</p>