title: Anonymous class not found after Obfuscating in Android
body: <p>I need some number of items from Javascript, so I am using the Gson to convert the JSON string into values as like the below code.</p>
  
  <p><strong>From Java script:</strong></p>
  
  <pre><code> var  Items = [{ "ItemName": "Item1", "ItemPos": "1", "ItemValue":"value1"},{ "ItemName": "Item2", "ItemPos": "2", "ItemValue":"value2"}];
  </code></pre>
  
  <p><strong>Invoking Native Android method</strong> passing these values as <strong>JSON.parse(items)</strong>.</p>
  
  <p>In Native class I have retrieved these values as below,</p>
  
  <pre><code> List&lt;Items&gt; ItemsList; 
   Gson gson = new Gson();
   ItemsList= gson.fromJson(args[0].toString(), new TypeToken&lt;List&lt;Items&gt;&gt;(){}.getType());
  </code></pre>
  
  <p>I have declared the Item class as below.</p>
  
  <pre><code>  public class Items
     {
      public String Name;
      public String Position;
      public String Value;
  
    }
  </code></pre>
  
  <p>These method of implementation works fine in the native source. But after obfuscating the source these method of implementation is not working. I am getting "<strong>Lookup failed</strong>" error. While decompile the obfuscated code, the Item class is not present in that place <strong>"anonymous class not found"</strong> is present. Even the declaration of the <strong>List ItemsList is also not present</strong>. How to resolve this issue?</p>
  
  <p><strong>EDIT 1 :
  MyProguard.pro</strong></p>
  
  <pre><code>-injars       input.jar
  -outjars      output.jar
  -libraryjars  android.jar
  -libraryjars  android-support-v4.jar
  -libraryjars  annotations.jar
  -libraryjars  gson-2.2.1.jar
  
  
  -dontpreverify
  -repackageclasses ''
  -allowaccessmodification
  -optimizations !code/simplification/arithmetic
  -keepattributes *Annotation*
  
  -keepparameternames
  -renamesourcefileattribute SourceFile
  -keepattributes Exceptions,InnerClasses,Signature,Deprecated,
              SourceFile,LineNumberTable,*Annotation*,EnclosingMethod
  
  -keep public class * {
    public protected *;
   }
  
  -keepclassmembernames class * {
    java.lang.Class class$(java.lang.String);
    java.lang.Class class$(java.lang.String, boolean);
  }
  
  -keepclasseswithmembernames class * {
     native &lt;methods&gt;;
  }
  
  -keepclassmembers enum * {
      public static **[] values();
      public static ** valueOf(java.lang.String);
   }
  
  -keepclassmembers class * implements java.io.Serializable {
      static final long serialVersionUID;
      private static final java.io.ObjectStreamField[] serialPersistentFields;
      private void writeObject(java.io.ObjectOutputStream);
      private void readObject(java.io.ObjectInputStream);
      java.lang.Object writeReplace();
      java.lang.Object readResolve();
   }
  
   -keep public class * extends android.app.Activity
   -keep public class * extends android.app.Application
   -keep public class * extends android.app.Service
   -keep public class * extends android.content.BroadcastReceiver
   -keep public class * extends android.content.ContentProvider
  
   -keep public class * extends android.view.View {
       public &lt;init&gt;(android.content.Context);
       public &lt;init&gt;(android.content.Context, android.util.AttributeSet);
       public &lt;init&gt;(android.content.Context, android.util.AttributeSet, int);
       public void set*(...);
    }
  
   -keepclasseswithmembers class * {
      public &lt;init&gt;(android.content.Context, android.util.AttributeSet);
    }
  
   -keepclasseswithmembers class * {
       public &lt;init&gt;(android.content.Context, android.util.AttributeSet, int);
    }
  
   -keepclassmembers class * extends android.content.Context {
      public void *(android.view.View);
      public void *(android.view.MenuItem);
     }
  
    -keepclassmembers class * implements android.os.Parcelable {
        static android.os.Parcelable$Creator CREATOR;
     }
  
   -keepclassmembers class **.R$* {
       public static &lt;fields&gt;;
    } 
  </code></pre>
  
  <p>I have obfuscated the source by "<strong>java -jar proguard.jar @MyProguard.pro</strong>"</p>