title: How do I remove "TAG" field from class using ProGuard?
body: <p>I'm trying to get my android ProGuard configuration working properly. So far I'm pretty happy with the results but there is one thing that's really bugging me; even if it's not that big of a deal.</p>
  
  <p>I copied the <code>proguard-android-optimize.txt</code> file and modified that to remove my logging using the following</p>
  
  <pre><code>-assumenosideeffects class com.my.package.Logger { *; }
  </code></pre>
  
  <p>I know <code>*;</code> is "bad" but it's my own logging class so it doesn't matter if things like <code>wait</code> are removed. The above works great to remove all my logging but I'm trying to remove the remaining <code>TAG</code> variables from all my classes. The <code>TAG</code> variables are defined like this:</p>
  
  <pre><code>private static final String TAG = thisClass.class.getSimpleName();
  </code></pre>
  
  <p>I've tried to remove them with configurations like these</p>
  
  <pre><code>-assumenosideeffects class com.my.package.** { static final *** TAG; }
  -assumenosideeffects class com.my.package.** { static final java.lang.String TAG; }
  -assumenosideeffects class com.my.package.thisClass { static final java.lang.String TAG; }
  </code></pre>
  
  <p>I've also tried to do it by attempting to remove all calls to <code>getSimpleName</code> but that didn't work either. Does anyone have any suggestions on how to remove these <code>TAG</code> fields that are no longer used?</p>
  
  <p><strong>Some additional information</strong>: The calls to the logger are not concatinating any string, that is to say the log messages and TAGs are used as such</p>
  
  <pre><code>com.my.package.Logger.log(TAG, "debug message");
  //NOT log(TAG + "debug message");
  </code></pre>
  
  <p>After ProGuard is run, the resulting <code>TAG</code> field is technically no longer used but ProGuard optimizes it to this</p>
  
  <pre><code>public void method()
  {
      String _tmp = a; //was Logger.log(TAG, "test");
      //_tmp is never used anywhere else in this method
  }
  
  private static final String a = com/my/package/thisClass/getSimpleName();
  </code></pre>