Home > Blockchain >  how to check the external dependency size in android studio
how to check the external dependency size in android studio

Time:10-11

How can I check the exact size of the dependency that I installed in android studio, is there any website to check the size..? I want to know the size of implementation 'com.google.android.exoplayer:exoplayer:2.X.X'

CodePudding user response:

You could make a task to sum the size of all the files in a configuration. Then add the dependency or dependencies that you want to check to that configuration. (In addition to the implementation configuration or whatever other configuration it is that they are needed for.)

configurations {
   justForSize
}

dependencies {
    implementation 'com.google.android.exoplayer:exoplayer:2.X.X'
    justForSize 'com.google.android.exoplayer:exoplayer:2.X.X'
}

tasks.register('dependencySize') {
    doLast {
        def depLength = 0L
        configurations.justForSize.forEach {
            println "${it} is ${it.length()} bytes"
            depLength  = it.length()
        }
        println "Total size of justForSize configuration is ${depLength}"
   }
}

Then just run that task:

gradle dependencySize
  • Related