I have an Android project with a
# ProGuard rules
The ViewPager class isn't kept in a small app that I just checked, so it must be other code or other rules in your project indeed.
You can start with letting ProGuard print out the chain that triggers ViewPager to be kept:
-whyareyoukeeping class android.support.v4.view.ViewPager
You may need to repeat this a number of times for various classes and methods to get to the root cause. ProGuard doesn't print out which rule exactly is responsible -- admittedly, this would be a useful feature.
You can then look for the
proguard.txt file in
build/intermediates/exploded-aar that contains a matching rule.
As for a solution at that point:
-keeprules; they only accumulate.
proguard.txtfiles in libraries, so you'd need to create a custom .aar file with the updated rule, or send a suggestion to the developers of the library.