title: Circular dependency between the following tasks while using firebase Crashlytics
body: <p>Today I just migrated from fabric crashlytics to Firebase crashlytics.</p>
  <p>Everything is working fine with <strong>minifyEnabled false</strong>, but when I changed the <strong>minifyEnabled true</strong> I got this exception:</p>
  <pre><code>Circular dependency between the following tasks:
  :app:checkManifestChangesDebug
  \--- :app:instantRunMainApkResourcesDebug
   \--- :app:transformClassesAndDexWithShrinkResForDebug
        \--- :app:transformDexArchiveWithDexMergerForDebug
             +--- :app:preColdswapDebug
             |    \--- :app:incrementalDebugTasks
             |         +--- :app:transformClassesAndClassesEnhancedWithInstantReloadDexForDebug
             |         |    \--- :app:transformClassesWithInstantRunForDebug
             |         |         \--- :app:checkManifestChangesDebug (*)
             |         \--- :app:transformClassesWithInstantRunForDebug (*)
             \--- :app:transformClassesWithDexBuilderForDebug
                  +--- :app:preColdswapDebug (*)
                  \--- :app:transformClassesWithInstantRunForDebug (*)
  
  (*) - details omitted (listed previously)
  </code></pre>
  <p><strong>Here is the project level build gradle</strong></p>
  <pre><code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
  
  buildscript {
  ext.butterknife_version = '8.8.1'
  ext.supportLibVersion = '28.0.0'
  ext.kotlin_version = '1.2.71'
  ext.retrofit_version = '2.3.0'
  ext.anko_version = '0.10.4'
  ext.google_play_service_version = '16.0.0'
  ext.firebase_messaging_version = '17.3.4'
  repositories {
      maven { url 'https://maven.google.com' }
      jcenter()
      google()
  
      //for firebase crashlytics
      maven {
          url 'https://maven.fabric.io/public'
      }
  }
  dependencies {
      classpath 'com.android.tools.build:gradle:3.2.1'
      classpath &quot;org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version&quot;
      classpath &quot;com.jakewharton:butterknife-gradle-plugin:$butterknife_version&quot;
      classpath 'com.google.gms:google-services:4.2.0'
      // NOTE: Do not place your application dependencies here; they belong
      // in the individual module build.gradle files
  
      classpath 'io.fabric.tools:gradle:1.27.0'
  }
  }
  
  allprojects {
  repositories {
      maven { url 'https://maven.google.com' }
      jcenter()
      maven {
          url &quot;https://github.com/omadahealth/omada-nexus/raw/master/release&quot;
      }
      maven {
          url 'https://maven.fabric.io/public'
      }
      maven { url &quot;https://jitpack.io&quot; }
      mavenCentral()
  }
  }
  
  task clean(type: Delete) {
  delete rootProject.buildDir
  }
  </code></pre>
  <p><strong>Here is the module build gradle</strong></p>
  <pre><code>apply plugin: 'com.android.application'
  apply plugin: 'kotlin-android'
  apply plugin: 'kotlin-kapt'
  apply plugin: 'kotlin-android-extensions'
  apply plugin: 'io.fabric'
  
  android {
  compileSdkVersion 28
  defaultConfig {
      applicationId &quot;com.mta.mmp&quot;
      minSdkVersion 21
      targetSdkVersion 28
      versionCode 18
      versionName &quot;1.2.0&quot;
      testInstrumentationRunner &quot;android.support.test.runner.AndroidJUnitRunner&quot;
      multiDexEnabled true
      dexOptions {
          javaMaxHeapSize &quot;4g&quot;
      }
  }
  buildTypes {
      release {
          minifyEnabled true
          shrinkResources true
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          buildConfigField 'String', 'FirebaseTopicForPushNotification', &quot;\&quot;PROD_ANDROID_BROADCAST_MMP\&quot;&quot;
      }
      dev {
          minifyEnabled true
          shrinkResources true
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          buildConfigField 'String', 'FirebaseTopicForPushNotification', &quot;\&quot;UAT_ANDROID_BROADCAST_MMP\&quot;&quot;
      }
      debug {
          minifyEnabled true
          shrinkResources true
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          buildConfigField 'String', 'FirebaseTopicForPushNotification', &quot;\&quot;UAT_ANDROID_BROADCAST_MMP\&quot;&quot;
      }
  }
  compileOptions {
      sourceCompatibility JavaVersion.VERSION_1_8
      targetCompatibility JavaVersion.VERSION_1_8
  }
  }
  
  
  repositories {
  maven { url &quot;https://jitpack.io&quot; }
  }
  
  
  
  dependencies {
  implementation fileTree(dir: 'libs', include: ['*.jar'])
  androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
      exclude group: 'com.android.support', module: 'support-annotations'
  })
  configurations {
      all*.exclude group: 'com.android.support', module: 'support-v13'
  }
  testImplementation 'junit:junit:4.12'
  
  //kotlin
  implementation &quot;org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version&quot;
  
  implementation &quot;com.android.support:appcompat-v7:$supportLibVersion&quot;
  implementation &quot;com.android.support:design:$supportLibVersion&quot;
  implementation &quot;com.android.support:recyclerview-v7:$supportLibVersion&quot;
  implementation &quot;com.android.support:cardview-v7:$supportLibVersion&quot;
  implementation &quot;com.android.support:support-v4:$supportLibVersion&quot;
  
  //retrofit 2
  implementation &quot;com.squareup.retrofit2:retrofit:$retrofit_version&quot;
  implementation &quot;com.squareup.retrofit2:retrofit:$retrofit_version&quot;
  
  //retrofit http interceptor
  implementation 'com.squareup.okhttp3:logging-interceptor:3.11.0'
  
  //gson converter factory
  implementation &quot;com.squareup.retrofit2:adapter-rxjava2:$retrofit_version&quot;
  implementation &quot;com.squareup.retrofit2:converter-gson:$retrofit_version&quot;
  implementation 'com.google.code.gson:gson:2.8.2'
  
  //RxAndroid
  implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
  implementation 'io.reactivex.rxjava2:rxjava:2.2.0'
  
  //picaso library
  implementation 'com.squareup.picasso:picasso:2.5.2'
  
  //form validation library
  implementation 'com.mobsandgeeks:android-saripaar:2.0.3'
  
  //font library
  implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
  
  //material dialog
  implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
  
  //joda time
  implementation 'net.danlew:android.joda:2.9.4.3'
  
  //circleimageview
  implementation 'de.hdodenhof:circleimageview:2.2.0'
  
  //recyclerview animation
  implementation 'jp.wasabeef:recyclerview-animators:2.2.5'
  
  //Butterknife
  implementation &quot;com.jakewharton:butterknife:$butterknife_version&quot;
  kapt &quot;com.jakewharton:butterknife-compiler:$butterknife_version&quot;
  
  //rx runtime permissions
  implementation 'com.tbruyelle.rxpermissions2:rxpermissions:0.9.5@aar'
  
  //rx binding
  implementation 'com.jakewharton.rxbinding2:rxbinding:2.1.1'
  
  //pinlib
  //    compile project(':pinLib')
  
  //circle indicator
  implementation 'me.relex:circleindicator:1.2.2@aar'
  
  //AndroidSlidingUpPanel
  implementation 'com.sothree.slidinguppanel:library:3.3.1'
  
  //toasty
  implementation 'com.github.GrenderG:Toasty:1.2.5'
  
  //for google map
  implementation &quot;com.google.android.gms:play-services-maps:$google_play_service_version&quot;
  
  //for location
  implementation &quot;com.google.android.gms:play-services-location:$google_play_service_version&quot;
  
  //Transitions Everywhere
  implementation &quot;com.andkulikov:transitionseverywhere:1.7.4&quot;
  
  //Android-Iconics
  implementation &quot;com.mikepenz:iconics-core:2.8.8@aar&quot;
  implementation &quot;com.android.support:appcompat-v7:${supportLibVersion}&quot;
  implementation 'com.mikepenz:google-material-typeface:3.0.1.1.original@aar'
  
  //Multidex
  implementation 'com.android.support:multidex:1.0.3'
  
  //for recyclerview swipe
  implementation 'com.chauthai.swipereveallayout:swipe-reveal-layout:1.4.1'
  
  //RippleView
  implementation 'com.github.traex.rippleeffect:ripple:1.3.1-OG'
  
  //TypefaceView
  implementation 'com.github.omadahealth.typefaceview:typefaceview:1.5.0@aar'
  
  //firebase Cloud Messaging
  implementation &quot;com.google.firebase:firebase-messaging:$firebase_messaging_version&quot;
  implementation 'com.google.firebase:firebase-core:16.0.6'
  
  //qr scanner
  implementation 'me.dm7.barcodescanner:zxing:1.9.4'
  
  //MaterialDateTimePicker
  implementation 'com.wdullaer:materialdatetimepicker:3.6.0'
  
  implementation 'com.github.drawers:SpinnerDatePicker:1.0.6'
  
  //anko
  implementation &quot;org.jetbrains.anko:anko:$anko_version&quot;
  
  // Anko Commons
  implementation &quot;org.jetbrains.anko:anko-commons:$anko_version&quot;
  
  //google maps utils
  implementation 'com.google.maps.android:android-maps-utils:0.5+'
  
  //crashlytics
  implementation 'com.crashlytics.sdk.android:crashlytics:2.9.7'
  
  //kotpref
  implementation &quot;com.chibatching.kotpref:kotpref:2.4.0&quot;
  implementation &quot;com.chibatching.kotpref:initializer:2.4.0&quot; // optional
  implementation &quot;com.chibatching.kotpref:enum-support:2.4.0&quot; // optional
  implementation &quot;com.chibatching.kotpref:gson-support:2.4.0&quot; // optional
  
  //rootbear
  implementation 'com.scottyab:rootbeer-lib:0.0.6'
  
  //autofittextview
  implementation 'me.grantland:autofittextview:0.2.+'
  
  //libphonenumber
  implementation 'io.michaelrocks:libphonenumber-android:8.9.0'
  
  //ksfmememory lib
  //implementation(name: 'ksfmemoryidlib-release', ext: 'aar')
  implementation 'org.apache.commons:commons-compress:1.15'
  
  //rounded imageview
  implementation 'com.makeramen:roundedimageview:2.3.0'
  
  //Scaling layout
  implementation 'com.github.iammert:ScalingLayout:1.2.1'
  
  //Crisp MMP
  implementation 'im.crisp:crisp-sdk:0.1.8'
  
  //slider from daimajia
  implementation 'com.daimajia.slider:library:1.1.5@aar'
  implementation 'com.nineoldandroids:library:2.4.0'
  implementation 'com.github.bumptech.glide:glide:4.8.0'
  kapt 'com.github.bumptech.glide:compiler:4.8.0'
  
  implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.+'
  
  //Camera view
  implementation 'com.otaliastudios:cameraview:1.5.1'
  
  //Picasso2-okhttp3-downloader
  implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'
  
  //Restring 1.0
  implementation 'com.ice.restring:restring:1.0.0'
  }
  
  repositories {
  flatDir {
      dirs 'libs'
  }
  }
  
  apply plugin: 'com.google.gms.google-services'
  </code></pre>
  <p><strong>And proguard for the crashlytics is</strong></p>
  <pre><code>#PROGUARD RULE FOR FIREBASE CRASHLYTICS
  #----------------------------------------------------------------------
  # https://firebase.google.com/docs/crashlytics/get-deobfuscated-reports
  -keepattributes *Annotation*
  -keepattributes SourceFile,LineNumberTable
  -keep public class * extends java.lang.Exception
  
  # To let Crashlytics automatically upload the ProGuard or DexGuard mapping 
  file, remove this line from the config file
  # -printmapping mapping.txt
  
  -keep class com.crashlytics.** { *; }
  -dontwarn com.crashlytics.**
  </code></pre>