Tobias
Tobias

Reputation: 7415

Proguard keep class actionbarsherlock

There was

-keep class com.actionbarsherlock.** { *; }

in my proguard config. As proposesd by the Actionbarsherlock guys (see http://actionbarsherlock.com/faq.html). But only after adding

-keep public class * extends com.actionbarsherlock.app.SherlockFragment

the classes which extended SherlockFragment were kept and so I was able to use the Fragments.

Why?

Upvotes: 3

Views: 2916

Answers (1)

StenaviN
StenaviN

Reputation: 3697

Let's assume you have the following fragment declaration, used in xml layout:

public class MyFragment extends SherlockFragment {
    …
}

MyFragment class isn't in com.actionbarsherlock.* package, so ProGuard will obfuscate class name. In order to keep classes, which might be used in xml layout, add these parameters:

# keep all classes that might be used in XML layouts
-keep public class * extends android.view.View
-keep public class * extends android.view.ViewGroup
-keep public class * extends android.support.v4.app.Fragment

Upvotes: 5

Related Questions