title: "Task 'compile' is ambiguous in root project" - Android Studio
body: <p>Every time I try to run my project, clean it or build it I get a gradle error:</p>
  
  <pre><code>Error:FAILURE: Build failed with an exception.
  
  * What went wrong:
  Task 'compile' is ambiguous in root project 'FifiFun2'. Candidates are: 'compileDebugAidl', 'compileDebugAndroidTestAidl', 'compileDebugAndroidTestJavaWithJavac', 'compileDebugAndroidTestNdk', 'compileDebugAndroidTestRenderscript', 'compileDebugAndroidTestSources', 'compileDebugJavaWithJavac', 'compileDebugNdk', 'compileDebugRenderscript', 'compileDebugSources', 'compileDebugUnitTestJavaWithJavac', 'compileDebugUnitTestSources', 'compileLint', 'compileReleaseAidl', 'compileReleaseJavaWithJavac', 'compileReleaseNdk', 'compileReleaseRenderscript', 'compileReleaseSources', 'compileReleaseUnitTestJavaWithJavac', 'compileReleaseUnitTestSources'.
  
  * Try:
  Run gradle tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
  </code></pre>
  
  <p>I have tried running gradle tasks with the options above (stacktrace,info,debug) but nothing helpful came up.</p>
  
  <p>gradle:</p>
  
  <pre><code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
  
  buildscript {
      repositories {
          jcenter()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:1.3.0'
  
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
      }
  }
  
  allprojects {
      repositories {
          jcenter()
      }
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  </code></pre>
  
  <p>main gradle file:</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 23
      buildToolsVersion "23.0.1"
  
      defaultConfig {
          applicationId "com.example.user_pc.myapplication"
          minSdkVersion 19
          targetSdkVersion 23
          versionCode 1
          versionName "1.0"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      testCompile 'junit:junit:4.12'
      compile 'com.android.support:appcompat-v7:23.0.1'
  }
  </code></pre>
  
  <p>settings.gradle file:</p>
  
  <pre><code>include ':app'
  </code></pre>
  
  <p>Screenshot of the problem:</p>
  
  <p><a href="https://i.stack.imgur.com/31doW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/31doW.png" alt="enter image description here"></a></p>