1

Up till now I am using AppCompat libraries but now I have migrated my project to AndroidX libraries.

I am stuck with proguard rules for androidx.

As you know we are using proguard rules for AppCompat as below:

-keep public class android.support.v7.widget.** { *; }
-keep public class android.support.v7.internal.widget.** { *; }
-keep public class android.support.v7.internal.view.menu.** { *; }

-keep public class * extends android.support.v4.view.ActionProvider {
    public <init>(android.content.Context);
}

I have searched a lot but didn't found any proper docs for that.

Is there any update in AndroidX Proguard rules?

Pratik Butani
  • 60,504
  • 58
  • 273
  • 437
  • I think you just need to replace `android.support.v7` by `androidx.appcompat` and For ActionProvider Use `androidx.core.view.ActionProvider` . And `androidx.appcompat.widget` in place of `android.support.v7.internal.widget` .. My point is just follow the mapping and [see the output](https://stackoverflow.com/questions/25724645/where-does-android-studio-save-the-proguard-mapping-file) . – ADM Apr 07 '19 at 04:02

1 Answers1

13

AppCompat already contains the ProGuard rules it needs directly in the AAR: there's no need to declare any special ProGuard rules.

Therefore, you can just remove your custom rules entirely.

ianhanniballake
  • 191,609
  • 30
  • 470
  • 443