title: Gradle. Can't build simple Android Project
body: <p>I have starting to learn a Gradle and try to make a first <strong>build.gradle</strong> file</p>
  
  <pre><code>println 'Build start.'
  buildscript {
      repositories {
          mavenCentral()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:0.4'
      }
  }
  println 'Current gradle version : '+gradle.gradleVersion
  apply plugin: 'android'
  
  dependencies {
      compile fileTree(dir: 'libs', include: '*.jar')
  }
  
  android {
      compileSdkVersion 15
      buildToolsVersion '19.0.0'
  
      sourceSets {
          main {
              manifest.srcFile 'AndroidManifest.xml'
              java.srcDirs ['src','src_default']
              res.srcDirs ['res']
          }
          androidTest.setRoot('tests')
      }
  }
  </code></pre>
  
  <h3>After <code>gradle build</code> :</h3>
  
  <pre><code>&gt; Could not resolve all dependencies for configuration ':classpath'.
     &gt; Could not resolve com.android.tools.build:gradle:0.4.
       Required by:           
           :hello_gradle:unspecified
        &gt; Could not GET 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/0.4/gradle-0.4.pom'.
           &gt; peer not authenticated
  
  * Try:                      
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
  </code></pre>
  
  <h3>After <code>gradle clean</code> :</h3>
  
  <pre><code>* Where:                    
  Build file '/home/sergey/Documents/dev_master/hello_gradle/build.gradle' line: 11
  
  * What went wrong:          
  A problem occurred evaluating root project 'p4_common_platform'.
  &gt; Failed to apply plugin [id 'android']
     &gt; Could not create plugin of type 'AppPlugin'.
  </code></pre>
  
  <h3>After <code>gradle clean --stacktrace</code> :</h3>
  
  <pre><code>* Exception is:
  org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'p4_common_platform'.
      at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:54)
      at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:148)
      at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:39)
      at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26)
      at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34)
      at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:59)
      at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:504)
      at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:83)
      at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:42)
      at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)
      at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:129)
      at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106)
      at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86)
      at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:80)
      at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
      at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
      at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:36)
      at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
      at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:51)
      at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
      at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237)
      at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
      at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
      at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
      at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
      at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
      at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
      at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
      at org.gradle.launcher.Main.doAction(Main.java:33)
      at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
      at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
      at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
      at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
  Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin [id 'android']
      at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyPlugin(DefaultObjectConfigurationAction.java:117)
      at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:36)
      at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:80)
      at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:131)
      at org.gradle.api.internal.project.AbstractPluginAware.apply(AbstractPluginAware.java:37)
      at org.gradle.api.Project$apply$0.call(Unknown Source)
      at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.groovy:34)
      at org.gradle.api.Script$apply$0.callCurrent(Unknown Source)
      at build_362n2fdy03onxvkm655devi4f.run(/home/sergey/Documents/dev_master/p4_common_platform/build.gradle:11)
      at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
      ... 32 more
  Caused by: org.gradle.api.plugins.PluginInstantiationException: Could not create plugin of type 'AppPlugin'.
      at org.gradle.api.internal.plugins.DefaultPluginRegistry.loadPlugin(DefaultPluginRegistry.java:71)
      at org.gradle.api.internal.plugins.DefaultPluginContainer.providePlugin(DefaultPluginContainer.java:187)
      at org.gradle.api.internal.plugins.DefaultPluginContainer.addPluginInternal(DefaultPluginContainer.java:137)
      at org.gradle.api.internal.plugins.DefaultPluginContainer.apply(DefaultPluginContainer.java:103)
      at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyPlugin(DefaultObjectConfigurationAction.java:115)
      ... 41 more
  Caused by: java.lang.NoClassDefFoundError: org/gradle/api/artifacts/result/ResolvedModuleVersionResult
      at com.android.build.gradle.AppPlugin.$getStaticMetaClass(AppPlugin.groovy)
      at com.android.build.gradle.BasePlugin.&lt;init&gt;(BasePlugin.groovy:1627)
      at com.android.build.gradle.AppPlugin.&lt;init&gt;(AppPlugin.groovy:73)
      at org.gradle.api.internal.DependencyInjectingInstantiator.newInstance(DependencyInjectingInstantiator.java:48)
      at org.gradle.api.internal.plugins.DefaultPluginRegistry.loadPlugin(DefaultPluginRegistry.java:69)
      ... 45 more
  Caused by: java.lang.ClassNotFoundException: org.gradle.api.artifacts.result.ResolvedModuleVersionResult
      ... 50 more
  </code></pre>
  
  <p>What i'm doing wrong?</p>