title: dependency conflict when build react-native-firebase for Android (Multiple dex files define Lcom/google/firebase/iid/zzb$1)
body: <p>I am trying to build react-native firebase for android, and keep getting error on build 
  <a href="https://github.com/invertase/react-native-firebase/blob/master/docs/installation.android.md" rel="nofollow noreferrer">https://github.com/invertase/react-native-firebase/blob/master/docs/installation.android.md</a></p>
  
  <p>here is the error </p>
  
  <pre><code>Execution failed for task ':app:transformClassesWithDexForDebug'.
  &gt; com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/google/firebase/iid/zzb$1;
  </code></pre>
  
  <p>I check <code>gradle app:dependencies</code> and see that <code>com.google.firebase:firebase-core</code> and <code>com.google.android.gms:play-services-base</code> is being add as version <code>10.2.1</code> and <code>10.2.0</code>. <code>react-native-push-notification</code> add version <code>10.2.1</code> for <code>play-services</code>. I think this might be the reason, here is the output for dependencies </p>
  
  <pre><code>+--- project :react-native-firebase
  |    +--- com.android.support:multidex:1.0.1
  |    +--- com.facebook.react:react-native:+ -&gt; 0.42.0 (*)
  |    +--- me.leolin:ShortcutBadger:1.1.10
  |    +--- com.google.android.gms:play-services-base:10.2.0 -&gt; 10.2.1
  |    |    +--- com.google.android.gms:play-services-basement:10.2.1
  |    |    |    \--- com.android.support:support-v4:24.0.0 -&gt; 25.0.0 (*)
  |    |    \--- com.google.android.gms:play-services-tasks:10.2.1
  |    |         \--- com.google.android.gms:play-services-basement:10.2.1 (*)
  |    +--- com.google.firebase:firebase-core:10.2.0
  |    |    \--- com.google.firebase:firebase-analytics:10.2.0
  |    |         +--- com.google.android.gms:play-services-basement:10.2.0 -&gt; 10.2.1 (*)
  |    |         +--- com.google.firebase:firebase-common:10.2.0
  |    |         |    +--- com.google.android.gms:play-services-basement:10.2.0 -&gt; 10.2.1 (*)
  |    |         |    \--- com.google.android.gms:play-services-tasks:10.2.0 -&gt; 10.2.1 (*)
  |    |         \--- com.google.firebase:firebase-analytics-impl:10.2.0
  |    |              +--- com.google.android.gms:play-services-basement:10.2.0 -&gt; 10.2.1 (*)
  |    |              +--- com.google.firebase:firebase-iid:10.2.0
  |    |              |    +--- com.google.android.gms:play-services-basement:10.2.0 -&gt; 10.2.1 (*)
  |    |              |    \--- com.google.firebase:firebase-common:10.2.0 (*)
  |    |              +--- com.google.firebase:firebase-common:10.2.0 (*)
  |    |              \--- com.google.android.gms:play-services-tasks:10.2.0 -&gt; 10.2.1 (*)
  |    +--- com.google.firebase:firebase-config:10.2.0
  |    |    +--- com.google.android.gms:play-services-base:10.2.0 -&gt; 10.2.1 (*)
  |    |    +--- com.google.android.gms:play-services-basement:10.2.0 -&gt; 10.2.1 (*)
  |    |    +--- com.google.firebase:firebase-iid:10.2.0 (*)
  |    |    +--- com.google.firebase:firebase-common:10.2.0 (*)
  |    |    \--- com.google.android.gms:play-services-tasks:10.2.0 -&gt; 10.2.1 (*)
  |    +--- com.google.firebase:firebase-auth:10.2.0
  |    |    +--- com.google.android.gms:play-services-base:10.2.0 -&gt; 10.2.1 (*)
  |    |    +--- com.google.android.gms:play-services-basement:10.2.0 -&gt; 10.2.1 (*)
  |    |    +--- com.google.firebase:firebase-common:10.2.0 (*)
  |    |    \--- com.google.android.gms:play-services-tasks:10.2.0 -&gt; 10.2.1 (*)
  |    +--- com.google.firebase:firebase-analytics:10.2.0 (*)
  |    +--- com.google.firebase:firebase-database:10.2.0
  |    |    +--- com.google.android.gms:play-services-basement:10.2.0 -&gt; 10.2.1 (*)
  |    |    +--- com.google.firebase:firebase-database-connection:10.2.0
  |    |    |    +--- com.google.android.gms:play-services-basement:10.2.0 -&gt; 10.2.1 (*)
  |    |    |    \--- com.google.firebase:firebase-common:10.2.0 (*)
  |    |    +--- com.google.firebase:firebase-common:10.2.0 (*)
  |    |    \--- com.google.android.gms:play-services-tasks:10.2.0 -&gt; 10.2.1 (*)
  |    +--- com.google.firebase:firebase-storage:10.2.0
  |    |    +--- com.google.android.gms:play-services-basement:10.2.0 -&gt; 10.2.1 (*)
  |    |    +--- com.google.firebase:firebase-storage-common:10.2.0
  |    |    |    \--- com.google.android.gms:play-services-basement:10.2.0 -&gt; 10.2.1 (*)
  |    |    +--- com.google.firebase:firebase-common:10.2.0 (*)
  |    |    \--- com.google.android.gms:play-services-tasks:10.2.0 -&gt; 10.2.1 (*)
  |    +--- com.google.firebase:firebase-messaging:10.2.0
  |    |    +--- com.google.android.gms:play-services-basement:10.2.0 -&gt; 10.2.1 (*)
  |    |    +--- com.google.firebase:firebase-iid:10.2.0 (*)
  |    |    \--- com.google.firebase:firebase-common:10.2.0 (*)
  |    \--- com.google.firebase:firebase-crash:10.2.0
  |         +--- com.google.android.gms:play-services-basement:10.2.0 -&gt; 10.2.1 (*)
  |         +--- com.google.firebase:firebase-iid:10.2.0 (*)
  |         +--- com.google.firebase:firebase-common:10.2.0 (*)
  |         \--- com.google.firebase:firebase-analytics:10.2.0 (*)
  +--- com.google.firebase:firebase-core:10.2.0 (*)
  +--- com.google.android.gms:play-services-base:10.2.0 -&gt; 10.2.1 (*)
  +--- project :bugsnag-react-native
  |    +--- com.bugsnag:bugsnag-android:3.7.2
  |    |    \--- com.android.support:support-annotations:23.1.1 -&gt; 25.0.0
  |    \--- com.facebook.react:react-native:+ -&gt; 0.42.0 (*)
  +--- project :react-native-push-notification
  |    +--- com.android.support:appcompat-v7:23.1.1 -&gt; 25.0.0 (*)
  |    +--- com.facebook.react:react-native:+ -&gt; 0.42.0 (*)
  |    +--- com.google.android.gms:play-services-gcm:+ -&gt; 10.2.1
  |    |    +--- com.google.android.gms:play-services-base:10.2.1 (*)
  |    |    +--- com.google.android.gms:play-services-basement:10.2.1 (*)
  |    |    \--- com.google.android.gms:play-services-iid:10.2.1
  |    |         +--- com.google.android.gms:play-services-base:10.2.1 (*)
  |    |         \--- com.google.android.gms:play-services-basement:10.2.1 (*)
  |    \--- me.leolin:ShortcutBadger:1.1.8 -&gt; 1.1.10
  +--- project :react-native-vector-icons
  |    \--- com.facebook.react:react-native:+ -&gt; 0.42.0 (*)
  +--- com.android.support:appcompat-v7:23.0.1 -&gt; 25.0.0 (*)
  \--- com.facebook.react:react-native:+ -&gt; 0.42.0 (*)
  </code></pre>
  
  <p>my top level build.gradle</p>
  
  <pre><code>buildscript {
      repositories {
          jcenter()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:2.3.1'
          classpath 'com.google.gms:google-services:3.0.0'
  
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
      }
  }
  
  allprojects {
      repositories {
          mavenLocal()
          jcenter()
          maven {
              // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
              url "$rootDir/../node_modules/react-native/android"
          }
      }
  }
  </code></pre>
  
  <p>My <code>app</code> build.gradle</p>
  
  <pre><code>dependencies {
      compile 'com.facebook.android:facebook-android-sdk:4.+'
      compile project(':react-native-fbsdk')
      compile project(':react-native-firebase')
      compile 'com.google.firebase:firebase-core:10.2.0'
      compile project(':bugsnag-react-native')
      compile project(':react-native-push-notification')
      compile project(':react-native-vector-icons')
      compile fileTree(dir: "libs", include: ["*.jar"])
      compile "com.android.support:appcompat-v7:23.0.1"
      compile "com.facebook.react:react-native:+"  // From node_modules
  }
  
  // Run this once to be able to run the application with BUCK
  // puts all compile dependencies into folder libs for BUCK to use
  task copyDownloadableDepsToLibs(type: Copy) {
      from configurations.compile
      into 'libs'
  }
  
  apply plugin: 'com.google.gms.google-services'
  </code></pre>
  
  <p><strong>Below are the dependencies that worked for me</strong> </p>
  
  <pre><code>dependencies {
  compile 'com.facebook.android:facebook-android-sdk:4.+'
  compile project(':react-native-fbsdk')
  compile project(':react-native-firebase')
  compile project(':bugsnag-react-native')
  compile project(':react-native-push-notification')
  compile project(':react-native-vector-icons')
  compile fileTree(dir: "libs", include: ["*.jar"])
  compile "com.android.support:appcompat-v7:23.0.1"
  compile "com.facebook.react:react-native:+"  // From node_modules
  compile 'com.google.firebase:firebase-core:10.2.1'
  compile 'com.google.firebase:firebase-config:10.2.1'
  compile 'com.google.firebase:firebase-auth:10.2.1'
  compile 'com.google.firebase:firebase-database:10.2.1'
  compile 'com.google.firebase:firebase-storage:10.2.1'
  compile 'com.google.firebase:firebase-messaging:10.2.1'
  compile 'com.google.firebase:firebase-crash:10.2.1'
  }
  </code></pre>