title: Where to place the apply Crashlytics plugin directive in Gradle build files
body: <p>Recently I have migrated my android project from Eclipse to Android Studio.
  Currently my project has the following Gradle script structure:</p>
  
  <ul>
  <li>Top-level gradle build file</li>
  <li>Main module (my app) gradle build file</li>
  <li>module A (my app) gradle build file</li>
  <li>module B (my app) gradle build file</li>
  <li>module C (my app) gradle build file</li>
  </ul>
  
  <p>The Content of my main gradle build file:</p>
  
  <pre><code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
  
  buildscript {
      repositories {
          mavenCentral()
          maven { url 'http://download.crashlytics.com/maven' }
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:1.2.1'
          classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
      }
  
  }
  
  allprojects {
      repositories {
          maven { url "http://dl.bintray.com/populov/maven" }
          mavenCentral()
      }
  }
  </code></pre>
  
  <p>I would like to make sure crashlytics would be present for the whole project.
  I initially tried to add</p>
  
  <pre><code>apply plugin: 'crashlytics'
  </code></pre>
  
  <p>to the main project gradle file, but I encountered the following error:</p>
  
  <blockquote>
    <p>Error:(2, 0) Crashlytics was applied to a project without an Android plugin. Please make sure the Crashlytics plugin is applied after the appropriate Android plugin for your project.</p>
  </blockquote>
  
  <p>I then moved the <code>apply plugin: 'crashlytics'</code> to the main module (my app) gradle build file and the build was successful.</p>
  
  <p>Since I am new to Gradle &amp; Android Studio, I was not sure if I need to it also to the submodules A, B, C to allow crashlytics to capture exceptions generating from those modules. Also I wonder why can't I (or how can I) add the " apply plugin: 'crashlytics' " to the main project gradle file.</p>
  
  <p>Could anyone clarify it for me?</p>