1

I've just reached the dex limit of 65536 methods and I am trying to solve this problem using proguard. Specifically I am trying to understand exactly what it is that Progurard tries to remove.

Does proguard only check for unused classes/methods in my code (that I wrote), or does it go a step further and check my project's dependencies and all the transitive dependencies of those. What if I am only using 1 method from a 10,000 methods jar dependency? Also, if it does remove transitive depenedencies, does it automatically remove all unused transitive dependencies or does it just report back, and I would have to manually exclude them in my pom.xml for example by doing this:

  <dependency>
        <groupId>cn.pedant.sweetalert</groupId>
        <artifactId>library</artifactId>
        <type>aar</type>
        <exclusions>
            <exclusion>
                <groupId>com.android.support</groupId>
                <artifactId>appcompat-v7</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

if I am not using the appcompat-v7 transitive dependency of the sweetalert dependency.

Finally, while we are at it, is the default proguard config file shipped with android tools ok, or do I need to tweak it?

sakis kaliakoudas
  • 2,039
  • 4
  • 31
  • 51

0 Answers0