title: Android setting up gradle build with dependancies
body: <p>I'm trying to set up a project to build with gradle, i've not used it before so I've cobbled together what I read on android tools.  I just want to be able to build the project via Main app with all its dependancies.  </p>
  
  <p>When i try and build from app and compile dependancies I get an exception:
  * What went wrong:
  Main Manifest missing from /Users/seren/Dropbox/codes/androids/mixcloud-work/android/Android/mixcloud/app/src/main/AndroidManifest.xml</p>
  
  <p>However if I take out the dependanices line for other modules, it will start compiling, until it inevitably fails: <code>compile project(':actionbarsherlock')</code></p>
  
  <p>EDIT - SO i made a test project consisting of two modules.  If I start out with the flat hierarchy i get the issue described.  However if i then move the submodule inside the main app module, the project builds no problems. I would like to keep a flat hierarchy though. </p>
  
  <p>My project structure is :</p>
  
  <p>Main app
  ActionBarSherlock
  Facebook SDK
  Utils - java only</p>
  
  <p>So I've set up a build.gradle file in each project directory as follows:</p>
  
  <pre><code>    buildscript {
      repositories {
          mavenCentral()
      }
  
      dependencies {
          classpath 'com.android.tools.build:gradle:0.3'
      }
  }
  
  apply plugin: 'android'
  
  dependencies {
      compile files (
              '../../libs/android-support-v4.jar',
      )
  }
  
  android {
      compileSdkVersion 17
      sourceSets {
          main {
              manifest.srcFile 'AndroidManifest.xml'
              java.srcDirs = ['src']
              resources.srcDirs = ['src']
              aild.srcDirs = ['src']
              renderscript.srcDirs = ['src']
              res.srcDirs = ['res']
              assets.srcDirs = ['assets']
          }
  
          instrumentTest.setRoot('tests')
      }
  
  }
  </code></pre>
  
  <p>Then with things like the utils that have more dependancies on modules like this:</p>
  
  <pre><code>dependencies {
      compile files (
              'libs/android-support-v4.jar',
              'libs/gson-2.2.2jar',
      )
  
      compile project(':facebook')
      compile project(':actionbarsherlock')
  }
  </code></pre>