title: How do I resolve a "'generateDebugSources' not found in project" error?
body: <p>I was trying to add a dependency to my application and I accidentally modified the wrong build.gradle file and now my application no longer builds correctly.</p>
  
  <p>This is my error:</p>
  
  <pre><code>Error:FAILURE: Build failed with an exception.
  
  * What went wrong:
  Task 'generateDebugSources' not found in project ':app'.
  
  * 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 was trying to implement the code that exists <a href="https://android-arsenal.com/details/1/1500" rel="noreferrer">here</a>, but I ended up breaking things in Android Studio because I am new to the gradle system.</p>
  
  <p>The files I edited were .idea/gradle.xml and build.gradle, which I am including below:</p>
  
  <p>build.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.1.0'
  
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
      }
  }
  
  allprojects {
      repositories {
          jcenter()
      }
  }
  </code></pre>
  
  <p>gradle.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project version="4"&gt;
    &lt;component name="GradleSettings"&gt;
      &lt;option name="linkedExternalProjectsSettings"&gt;
        &lt;GradleProjectSettings&gt;
          &lt;option name="distributionType" value="DEFAULT_WRAPPED" /&gt;
          &lt;option name="externalProjectPath" value="$PROJECT_DIR$" /&gt;
          &lt;option name="modules"&gt;
            &lt;set&gt;
              &lt;option value="$PROJECT_DIR$" /&gt;
              &lt;option value="$PROJECT_DIR$/app" /&gt;
            &lt;/set&gt;
          &lt;/option&gt;
        &lt;/GradleProjectSettings&gt;
      &lt;/option&gt;
    &lt;/component&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>I was trying to get as close as the default files are, but ended up making the problem worse and I cannot build my project anymore.</p>
  
  <p>Also, I am using Android Studio 1.1.0, which is shown to be the latest update.</p>
  
  <p>Thanks in advance, and if I need to provide more information, just let me know.</p>