keepclasseswithmembernames and keepclasseswithmembers difference

Some of the important attributes in proguard project properties include

-keep attribute
can be used with class, inteface enum etc

eg: -keep class com.smartandroidians.views.FloatingActionButtonBehavior which is not used in any java class and only used in xml files just like a string as

app:layout_behavior="com.smartandroidians.views.FloatingActionButtonBehavior"

proguard remove this class because it feels like it is not used anywhere but it is a very important class  for the app rather floating button to function.

Solution.
1) You can do something like this,
-keep class com.smartandroidians.views.FloatingActionButtonBehavior { *; }

or rather better approach is

2) -keepclasseswithmembernames class * {
    public (android.content.Context, android.util.AttributeSet);
}

Comments

Popular posts from this blog

AlarmManager and Notification in Android

Swipe Action and ViewFlipper in Android

Difference between SurfaceView and View in Android