title: Can't compile Android project with gradle after adding a library
body: <p>Before adding a library to my Android project the layout was like this:</p>
  
  <ul>
  <li>MyappProject
  <ul>
  <li>Myapp
  <ul>
  <li>build.gradle</li>
  </ul></li>
  </ul></li>
  <li>settings.gradle</li>
  <li>build.gradle</li>
  </ul>
  
  <p>The top level build.gradle has always been empty, with the settings.gradle file containing only:</p>
  
  <pre><code>include ':Myapp'
  </code></pre>
  
  <p>I obtained a library project which I was able to import successfully into Android Studio, so I presume that the gradle files within it were fine. I now have the following structure:</p>
  
  <ul>
  <li>MyappProject
  <ul>
  <li>Myapp
  <ul>
  <li>build.gradle</li>
  </ul></li>
  <li>libraries
  <ul>
  <li>Library
  <ul>
  <li>LibrarySubProject1
  <ul>
  <li>build.gradle</li>
  </ul></li>
  <li>....</li>
  <li>build.gradle</li>
  </ul></li>
  </ul></li>
  </ul></li>
  <li>settings.gradle</li>
  <li>build.gradle</li>
  </ul>
  
  <p>...and the top level settings gradle now looks like:</p>
  
  <pre><code>include ':Myapp'
  include ':libraries:Library'
  </code></pre>
  
  <p>I've also updated Myapp's build.gradle so it includes the extra last line in dependencies here:</p>
  
  <pre><code>dependencies {
      compile 'com.android.support:support-v4:+'
      compile files('libs/commons-lang3-3.1.jar')
      compile files('libs/jsoup-1.7.3.jar')
      compile project(':libraries:Library')
  }
  </code></pre>
  
  <p>Unfortunately, any attempt to do anything with gradle (sync files, build etc.) now gets me the following:</p>
  
  <pre><code>Gradle 'MyappProject' project refresh failed:
       Configuration with name 'default' not found.
       Gradle settings
  </code></pre>
  
  <p>Any changes to the settings appear to have no effect, and Android Studio keeps the settings set to "use default gradle wrapper". 
  From what I understand, that means that there is a problem with the top level build.gradle along the lines of this file not containing sufficient information to build the sub projects. But, perhaps I have misunderstood, as Myapp used to build and Library also seems fine. Removing the compile project(':libraries:Library') allows gradle file syncing again, but I would like to use that library...</p>
  
  <p>Any suggestions as to how to fix this would be welcome.</p>
  
  <p>Edited to add build.gradle from Library. Top level:</p>
  
  <pre><code>buildscript {
      repositories {
          mavenCentral()
      }
  
      dependencies {
          classpath 'com.android.tools.build:gradle:0.9.+'
      }
  }
  
  allprojects {
      version = VERSION_NAME
      group = GROUP
  
      repositories {
          mavenCentral()
      }
  }
  </code></pre>
  
  <p>From the next level:</p>
  
  <pre><code>apply plugin: 'android-library'
  
  android {
      compileSdkVersion 19
      buildToolsVersion "19.0.3"
  
      defaultConfig {
          minSdkVersion 14
          targetSdkVersion 19
      }
  
      sourceSets {
          main {
              manifest.srcFile 'AndroidManifest.xml'
              java.srcDirs = ['src']
              resources.srcDirs = ['src']
              aidl.srcDirs = ['src']
              renderscript.srcDirs = ['src']
              res.srcDirs = ['res']
              assets.srcDirs = ['assets']
          }
  
          instrumentTest.setRoot('tests')
  
          debug.setRoot('build-types/debug')
          release.setRoot('build-types/release')
      }
  }
  
  apply from: 'https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle'
  </code></pre>