title: What are the recommended proguard settings for android support library?
body: <p>I am using android-support-library-v7 in my project and of course I would like to use progurad to minimize and obfuscate my code.
  The problem is that if I use proguard I get errors similar to this:</p>
  
  <pre><code>FATAL EXCEPTION: main java.lang.RuntimeException: Unable to start activity ComponentInfo{org.example.project/org.example.project.ActivityMain}: android.view.InflateException: Binary XML file line #12: Error inflating class android.support.v7.preference.PreferenceCategory
      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2110)
      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2135)
      at android.app.ActivityThread.access$700(ActivityThread.java:140)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237)
      at android.os.Handler.dispatchMessage(Handler.java:99)
      at android.os.Looper.loop(Looper.java:137)
      at android.app.ActivityThread.main(ActivityThread.java:4921)
      at java.lang.reflect.Method.invokeNative(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:511)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
      at dalvik.system.NativeStart.main(Native Method) Caused by: android.view.InflateException: Binary XML file line #12: Error inflating class android.support.v7.preference.PreferenceCategory
      at android.support.v7.preference.g.a(Unknown Source)
      at android.support.v7.preference.g.a(Unknown Source)
      at android.support.v7.preference.g.a(Unknown Source)
      at android.support.v7.preference.g.a(Unknown Source)
      at android.support.v7.preference.g.a(Unknown Source)
      at android.support.v7.preference.h.a(Unknown Source)
      at android.support.v7.preference.h.b(Unknown Source)
      at org.exampple.project.ActivityMain.onCreate(Unknown Source)
      at android.app.Activity.performCreate(Activity.java:5206)
      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2074)
      ... 11 more Caused by: java.lang.NoSuchMethodException: &lt;init&gt; [class android.content.Context, interface android.util.AttributeSet]
      at java.lang.Class.getConstructorOrMethod(Class.java:460)
      at java.lang.Class.getConstructor(Class.java:431)
      ... 22 more
  </code></pre>
  
  <p>PreferenceCategory is used in my preferences.xml file and I guess it is accessed via reflection. Proguard if probably removes this method (or class) if it is not referenced in code when shrinking. And even if not it surely obfuscates the name.
  Google in itßs usual fashion provides absolutely no documentation on the subject.</p>
  
  <p>So, what are the optimum settings to achieve good shrinking and good obfuscation.
  There are some similar questions on Stack Overflow, but they boil down to:</p>
  
  <pre><code>-keep class android.support.v7.** { *; }
  </code></pre>
  
  <p>which cleary defeats the purpose of shrinking and obfuscating.</p>
  
  <p>Trying to randomly guess the settings or by try and error method is extremely time consuming.</p>