title: How to get dependencies size with gradle task in Android Studio?
body: <p>I need to create a task that displays each dependency size when executed.</p>
  
  <p>I've searched for a way to do it and the closest answer is <a href="https://gist.github.com/medvedev/968119d7786966d9ed4442ae17aca279" rel="nofollow noreferrer">this</a> however, this solution seems to work for non Android projects only.</p>
  
  <p>I'm currently using the <strong>tools.build:gradle:3.4.2</strong> and the <strong>gradle plugin for android 5.1.1</strong> </p>
  
  <p>I would like something to list each dependency and size like:</p>
  
  <pre><code>- Retrofit 2.5.0 ------ 654 KB.
  
  - Butterknife 10.1.0 -- 150 KB.
  </code></pre>
  
  <p>I tried to implement the gist I linked before but it always says:</p>
  
  <blockquote>
    <p>ERROR: Cannot change strategy of configuration ':app:androidApis' after it has been resolved.</p>
  </blockquote>
  
  <p>After removing a piece of the code for multiple configurations:</p>
  
  <blockquote>
    <p>ERROR: Cannot change strategy of configuration ':app:default' after it has been resolved.</p>
  </blockquote>
  
  <p>At this point I don't know what to put at configuration...</p>