I'm running my project in AndroidStudio 3.2, but there is an error
FAILURE: Build failed with an exception.
* What went wrong:
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)
I can still generate APKs manually, but the "Run" button doesn't work.
How can I solve the issue?
In a multi project build with a deep structure where several projects have the same short name (in different paths), if project depends on another project, you get a circular dependency error. Note: this is not related to the Kotlin Gradle plugin, as it can be reproduced with pure Java as well. FAILURE: Build failed with an exception.
Dependencies between projects Gradle can model dependencies between modules. Those dependencies are called project dependencies because each module is represented by a Gradle project. Example 10.
Removing a circular dependency cannot be resolved with build trickery. You're going to have to refactor your modules so there is no longer a circular dependency. From your module names, and with no other information, I would think you would want to extract the part of "common" that depends on "product-*" and put it into a new module.
Gradle represents the scope of a dependency with the help of a Configuration . Every configuration can be identified by a unique name. Many Gradle plugins add pre-defined configurations to your project.
Disable instant run from settings
Settings > search for instant run > uncheck "Enable Instant Run to hot swap code/resource changes on display"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With