title: Error: cmd: Command failed with exit code 1
body: <blockquote>
    <p>I got error when I try to run "D:\MyApp\app>ionic build android" command.Upto that all processes are work properly .Can any one tell me proper solution for that.Thanks in advance.</p>
  </blockquote>
  
  <pre><code>D:\MyApp\app&gt;ionic build android
  Running command: "C:\Program Files (x86)\nodejs\node.exe" D:\MyApp\app\hooks\aft
  er_prepare\010_add_platform_class.js D:\MyApp\app
  add to body class: platform-android
  Running command: cmd "/s /c "D:\MyApp\app\platforms\android\cordova\build.bat""
  ANDROID_HOME=C:\Users\rajitha\AppData\Local\Android\android-sdk
  JAVA_HOME=C:\Program Files\Java\jdk1.7.0_79
  Running: D:\MyApp\app\platforms\android\gradlew cdvBuildDebug -b D:\MyApp\app\pl
  atforms\android\build.gradle -Dorg.gradle.daemon=true
  
  FAILURE: Build failed with an exception.
  </code></pre>
  
  <blockquote>
    <p>I can not understand what are they telling to me.Because I set all environment variables ex-JAVA,ANDROID</p>
  </blockquote>
  
  <pre><code>* 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:
           :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/co
  m/android/tools/build/gradle/maven-metadata.xml.
              &gt; Could not GET 'https://repo1.maven.org/maven2/com/android/tools/bu
  ild/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.
  
  BUILD FAILED
  
  Total time: 6.474 secs
  
  D:\MyApp\app\platforms\android\cordova\node_modules\q\q.js:126
                      throw e;
                            ^
  Error code 1 for command: cmd with args: /s /c "D:\MyApp\app\platforms\android\g
  radlew cdvBuildDebug -b D:\MyApp\app\platforms\android\build.gradle -Dorg.gradle
  .daemon=true"
  ERROR building one of the platforms: Error: cmd: Command failed with exit code 1
  
  You may not have the required environment or OS to build this project
  Error: cmd: Command failed with exit code 1
      at ChildProcess.whenDone (C:\Users\rajitha\AppData\Roaming\npm\node_modules\
  cordova\node_modules\cordova-lib\src\cordova\superspawn.js:134:23)
      at ChildProcess.emit (events.js:110:17)
      at maybeClose (child_process.js:1015:16)
      at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
  </code></pre>