Circular dependency between the following tasks

But minifyEnabled is important in production. I have tried the following arrangement and it worked with instant run enabled:

minifyEnabled true
useProguard true
shrinkResources false

So this tends to happen when instant Run is enabled and shrinkResources is set to true as well.


For errors such this:

Circular dependency between the following tasks::app:bundleDebugClasses
\--- :app:compileDebugJavaWithJavac
     \--- :package_name:bundleLibCompileToJarDebug
          \--- :package_name:compileDebugJavaWithJavac
               \--- :app:bundleDebugClasses (*)

This error occurs because you have created a cycle between dependencies. This means two implementations that one belongs to the other is used, so you should remove additional implementation from below build.gradle in list of gradles. Another example: If package A is implemented in package B and also you needed to put B implementation in A and you did that, it makes this error.


This happens when a module depends on itself!

For example, suppose this for module app:

// ...
dependencies {
    implementation project(':app') // 'app' depends on 'app' !!!
    // ...
}

Or maybe x module depends on y and y depends on x!

Or even longer: x -> y -> ... -> x!!

Tags:

Android

Gradle