title: Adding Firebase Crashlytics either crash in runtime or fail unit test build
body: <p>I'm trying to add Firebase Crashlytics to a new Android app (single module, no flavors). Since Crashlytics is missing from the IDE assistant plugin, I'm using setup steps from <a href="https://firebase.google.com/docs/crashlytics/get-started" rel="noreferrer">https://firebase.google.com/docs/crashlytics/get-started</a>:</p>
  
  <ul>
  <li>add gradle dependencies</li>
  <li>download google-services.json and put it in the /app root</li>
  </ul>
  
  <p>Crashlytics is initialized for release builds only like this:</p>
  
  <pre><code>class MyApplication: Application() {
  
    fun onCreate() {
      super.onCreate()
      Fabric.with(
          this,
          Crashlytics.Builder()
              .core(CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build())
              .build()
      )
    }
  }
  </code></pre>
  
  <p><strong>The problem #1</strong>: app crashes during initialization with </p>
  
  <pre><code>java.lang.RuntimeException: Unable to get provider com.crashlytics.android.CrashlyticsInitProvider: io.fabric.sdk.android.services.concurrency.UnmetDependencyException: The Crashlytics build ID is missing. This occurs when Crashlytics tooling is absent from your app's build configuration. Please review Crashlytics onboarding instructions and ensure you have a valid Crashlytics account.
  </code></pre>
  
  <p>Adding </p>
  
  <pre><code>&lt;meta-data
    android:name="io.fabric.ApiKey"
    android:value="{blah-blah-key}" /&gt;
  </code></pre>
  
  <p>to AndroidManifest.xml fixes the issue (I'm seeing crashes in firebase console), but now I'm getting</p>
  
  <p><strong>Problem #2</strong>: running unit tests (<code>gradle test</code>) fails with </p>
  
  <pre><code>&gt; Task :app:fabricGenerateResourcesRelease FAILED
  ERROR - Crashlytics Developer Tools error.
  java.lang.IllegalArgumentException: Crashlytics found an invalid API key: blah-blah-key
  </code></pre>
  
  <p>TL;DR - gradle fails to run unit tests if Fabric api key is present in manifest, app crashes in runtime if it's not present. I suspect that I'm doing something wrong, but not sure what exactly :( </p>