Android Studio gradle's "calculate task graph" takes too long
<p>When building app in Android Studio, it takes too long (besides I use offline mode, latest gradle, etc).</p>

<p>I investigate, and see progress of each task, where most time is spent in <strong>Calculate task graph</strong> item. </p>

<p><a href="https://i.stack.imgur.com/VFA3p.png" rel="noreferrer"><img src="https://i.stack.imgur.com/VFA3p.png" alt="enter image description here"></a></p>

<p>Every single gradle task that I choose from <em>Gradle</em> tool window spend at least 9 seconds in this <em>Calculate task graph</em>.</p>

<p>How can I speed up this task, and why it takes so long, when other gradle tasks are usually cached (UP-TO-DATE)? I could possibly build much faster, but each app build adds 10 seconds, which is killer of productivity.</p>

<p>Any advice is welcome. Thanks.</p>