title: How to declare appcompat_v7 dependency in build.gradle within eclipse project setup?
body: <p>I am using Eclipse with ADT and want to build my project with Gradle(2.3). The project structure is the standard generated android eclipse project structure.
  I am using the android support library appcompat_7.
  The support libraries are installed and everything I need from the Android SDK is up-to-date.
  Here is my (failing) attempt to my build.gradle file (positioned at the root):</p>
  
  <pre><code>buildscript {
  repositories {
      mavenCentral()
  }
  
  dependencies {
      classpath 'com.android.tools.build:gradle:1.0.0'
  
      compile 'com.android.support:appcompat-v7:21.0.0'
  }
  }
  
  apply plugin: 'android'
  
  android {
  compileSdkVersion 22
  buildToolsVersion "22.0.1"
  
  sourceSets {
      main {
          manifest.srcFile 'AndroidManifest.xml'
          java.srcDirs = ['src']
          resources.srcDirs = ['src']
          aidl.srcDirs = ['src']
          renderscript.srcDirs = ['src']
          res.srcDirs = ['res']
          assets.srcDirs = ['assets']
      }
  
      androidTest.setRoot('tests')
  }
  }
  </code></pre>
  
  <p>I get the following BUILD FAILURE from gradle:</p>
  
  <pre><code>C:\Workspaces\EclipseAndroid\training2&gt;gradle build
  
  FAILURE: Build failed with an exception.
  
  * Where:
  Build file 'C:\Workspaces\EclipseAndroid\training2\build.gradle' line: 9
  
  * What went wrong:
  A problem occurred evaluating root project 'training2'.
  &gt; Could not find method compile() for arguments [com.android.support:appcompat-v7:21.0.0] on org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler_Decorated@3e7545e8.
  
  * 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: 5.663 secs
  </code></pre>
  
  <p>When I am leaving out the line about the appcompat dependency I get the following BUILD FAILURE:</p>
  
  <pre><code>:processDebugManifest UP-TO-DATE
  :processDebugResources
  C:\Workspaces\EclipseAndroid\training2\build\intermediates\res\debug\values\values.xml:9: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
  
  C:\Workspaces\EclipseAndroid\training2\build\intermediates\res\debug\values-v11\values.xml:5: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
  
  C:\Workspaces\EclipseAndroid\training2\build\intermediates\res\debug\values-v14\values.xml:5: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
  
  :processDebugResources FAILED
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':processDebugResources'.
  &gt; com.android.ide.common.internal.LoggedErrorException: Failed to run command:
  C:\Program Files (x86)\Android\android-sdk\build-tools\22.0.1\aapt.exe package -f --no-crunch -I C:\Program Files (x86)\Android\android-sdk\platforms\android-22\android.jar -M C:\Workspaces\EclipseAndroid\training2\build\intermediates\manifests\full\debug\AndroidManifest.xml -S C:\Workspaces\EclipseAndroid\training2\build\intermediates\res\debug -A C:\Workspaces\EclipseAndroid\training2\build\intermediates\assets\debug -m -J C:\Workspaces\EclipseAndroid\training2\build\generated\source\r\debug -F C:\Workspaces\EclipseAndroid\training2\build\intermediates\res\resources-debug.ap_ --debug-mode --custom-package com.example.training2 -0 apk
  Error Code:
  1
  Output:
  C:\Workspaces\EclipseAndroid\training2\build\intermediates\res\debug\values\values.xml:9: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
  
  C:\Workspaces\EclipseAndroid\training2\build\intermediates\res\debug\values-v11\values.xml:5: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
  
  C:\Workspaces\EclipseAndroid\training2\build\intermediates\res\debug\values-v14\values.xml:5: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
  
  
  
  * 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: 11.567 secs
  </code></pre>
  
  <p>How should I declare the dependencies in order to get the project build? </p>
  
  <p>In my opinion, this is a pretty basic question when you want to build an eclipse-android project with gradle, however I could not find a solution during my websearch, I hope you can help :)</p>