Menu

#574 Proguard shrinks overridden methods in abstract classes of a library project

v5.2
open
nobody
None
5
2015-05-25
2015-05-25
No

When shrkinking a library project, Proguard does not consider the overridden methods in abstract classes as used and shrinks them.

In the attached files, Animal class declares two methods - born() and died() and calls them from the constructor. Human class extends Animal and provides new implementation of born() and died(). However, when the project is proguarded with -keep public class test.Human the overridden methods are removed.

Proguard assumes that overridden methods are not used and shrinks them even though their super method is marked is used and retained. Note that this only happens in case of library project with abstract classes that do not have a concrete implementation within the project.

I am using android studio.

2 Attachments

Discussion


Log in to post a comment.

Auth0 Logo