title: Android Build Tools keep ProGuard from removing unused appcompat library classes
body: <p>Here's a part of my <code>build.gradle</code>:</p>
  
  <pre><code>android {
      buildTypes {
          release {
              minifyEnabled true
              shrinkResources true
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      compile 'com.android.support:appcompat-v7:21.0.3'
  }
  </code></pre>
  
  <p>There's nothing in <code>proguard-rules.pro</code> but I noticed a file named <code>aapt_rules.txt</code> was generated which has something like this:</p>
  
  <pre><code># view res/layout/abc_action_menu_item_layout.xml #generated:17
  -keep class android.support.v7.internal.view.menu.ActionMenuItemView { &lt;init&gt;(...); }
  
  # view res/layout/abc_expanded_menu_layout.xml #generated:17
  -keep class android.support.v7.internal.view.menu.ExpandedMenuView { &lt;init&gt;(...); }
  
  # view res/layout/abc_list_menu_item_layout.xml #generated:17
  # view res/layout/abc_popup_menu_item_layout.xml #generated:17
  -keep class android.support.v7.internal.view.menu.ListMenuItemView { &lt;init&gt;(...); }
  
  # view res/layout/abc_screen_toolbar.xml #generated:27
  -keep class android.support.v7.internal.widget.ActionBarContainer { &lt;init&gt;(...); }
  
  # view res/layout/abc_action_mode_bar.xml #generated:19
  # view res/layout/abc_screen_toolbar.xml #generated:43
  -keep class android.support.v7.internal.widget.ActionBarContextView { &lt;init&gt;(...); }
  
  # view res/layout/abc_screen_toolbar.xml #generated:17
  -keep class android.support.v7.internal.widget.ActionBarOverlayLayout { &lt;init&gt;(...); }
  
  # view res/layout/abc_screen_content_include.xml #generated:19
  -keep class android.support.v7.internal.widget.ContentFrameLayout { &lt;init&gt;(...); }
  
  # view res/layout/abc_screen_simple_overlay_action_mode.xml #generated:23
  -keep class android.support.v7.internal.widget.FitWindowsFrameLayout { &lt;init&gt;(...); }
  
  # view res/layout/abc_screen_simple.xml #generated:17
  -keep class android.support.v7.internal.widget.FitWindowsLinearLayout { &lt;init&gt;(...); }
  
  # view v11/res/layout-v11/abc_screen_content_include.xml #generated:19
  -keep class android.support.v7.internal.widget.NativeActionModeAwareLayout { &lt;init&gt;(...); }
  
  # view res/layout/abc_action_mode_close_item_material.xml #generated:17
  # view res/layout/abc_search_dropdown_item_icons_2line.xml #generated:27
  # view res/layout/abc_search_dropdown_item_icons_2line.xml #generated:37
  # view res/layout/abc_search_dropdown_item_icons_2line.xml #generated:48
  # view res/layout/abc_search_view.xml #generated:116
  # view res/layout/abc_search_view.xml #generated:128
  # view res/layout/abc_search_view.xml #generated:38
  # view res/layout/abc_search_view.xml #generated:60
  # view res/layout/abc_search_view.xml #generated:97
  -keep class android.support.v7.internal.widget.TintImageView { &lt;init&gt;(...); }
  
  # view res/layout/abc_screen_simple.xml #generated:25
  # view res/layout/abc_screen_simple_overlay_action_mode.xml #generated:32
  -keep class android.support.v7.internal.widget.ViewStubCompat { &lt;init&gt;(...); }
  
  # view res/layout/abc_action_menu_layout.xml #generated:17
  -keep class android.support.v7.widget.ActionMenuView { &lt;init&gt;(...); }
  
  # view res/layout/abc_activity_chooser_view.xml #generated:19
  -keep class android.support.v7.widget.LinearLayoutCompat { &lt;init&gt;(...); }
  
  # view res/layout/abc_search_view.xml #generated:78
  -keep class android.support.v7.widget.SearchView$SearchAutoComplete { &lt;init&gt;(...); }
  
  # view res/layout/abc_screen_toolbar.xml #generated:36
  -keep class android.support.v7.widget.Toolbar { &lt;init&gt;(...); }
  </code></pre>
  
  <p>Which obviously keeps everything used by XMLs in the support library even if those XMLs are not used at all. And the codes that are kept again keeps all the resources from being skipped using <code>shrinkResources true</code>. And the apk size increased a lot even nothing in the support library is used. The same thing goes with other libraries.</p>
  
  <p>So is there a way to customize <code>aapt_rules.txt</code> or do something like that to remove those unused code and resources? (or do I need to open an issue for this somewhere?)</p>