title: GSON java.lang.IllegalArgumentException: class android.widget.TextView declares multiple JSON fields named mMinWidth
body: <p><em>What I'm doing to do: I'm trying to use GSON to serailize an ArrayList of custom objects. I'm making a chat app so I need to save the conversations.</em></p>
  
  <p>I've looked at a number of different solutions of the same question and I know the answer.. GSON is trying to serialize a field object that is both in the child class and super class, but my case is a bit more difficult because I don't have access to either of those classes. Here is my stack trace.</p>
  
  <pre><code>java.lang.IllegalArgumentException: class android.widget.TextView declares multiple JSON fields named mMinWidth
      at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:172)
      at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:102)
      at com.google.gson.Gson.getAdapter(Gson.java:458)
      at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:117)
      at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:166)
      at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:102)
      at com.google.gson.Gson.getAdapter(Gson.java:458)
      at com.google.gson.internal.bind.ArrayTypeAdapter$1.create(ArrayTypeAdapter.java:48)
      at com.google.gson.Gson.getAdapter(Gson.java:458)
      at com.google.gson.Gson.toJson(Gson.java:696)
      at com.google.gson.Gson.toJson(Gson.java:683)
      at com.google.gson.Gson.toJson(Gson.java:638)
      at com.google.gson.Gson.toJson(Gson.java:618)
      at com.widener.ConversationHistoryActivity.saveConversationList(ConversationHistoryActivity.java:93)
      at com.widener.ConversationHistoryActivity$2.onClick(ConversationHistoryActivity.java:81)
      at android.view.View.performClick(View.java:7870)
      at android.widget.TextView.performClick(TextView.java:14951)
      at android.view.View.performClickInternal(View.java:7839)
      at android.view.View.access$3600(View.java:886)
      at android.view.View$PerformClick.run(View.java:29315)
      at android.os.Handler.handleCallback(Handler.java:883)
      at android.os.Handler.dispatchMessage(Handler.java:100)
      at android.os.Looper.loop(Looper.java:237)
      at android.app.ActivityThread.main(ActivityThread.java:7762)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1047)
  </code></pre>
  
  <p>As you can see, it seems to be complaining about <code>int mMinWidth</code> in both TextView and View, it's super class. I'm completely lost and I'm not sure what to include from my code but I'll do my best. Comment if you need more information.</p>
  
  <p>Code causing issue:</p>
  
  <pre><code>public void saveConversationList()
      {
          SharedPreferences sharedPreferences = getSharedPreferences(SharedPrefStrings.SHARED_PREFS, Context.MODE_PRIVATE);
          SharedPreferences.Editor editor = sharedPreferences.edit();
          Gson gson = new Gson();
          String jsonOne = gson.toJson(ConversationWrapper.conversationsHistoryList); ERROR ON THIS LINE
          String jsonTwo = gson.toJson(ConversationWrapper.activeConversationIDs);
          editor.putString(SharedPrefStrings.CONVERSATION_LIST, jsonOne);
          editor.putString(SharedPrefStrings.CONVERSATION_LIST_IDS, jsonTwo);
          editor.commit();
      }
  </code></pre>
  
  <p>ConversationWrapper class:</p>
  
  <pre><code>public class ConversationWrapper {
      public static ArrayList&lt;Conversation&gt; conversationsHistoryList;
  }
  </code></pre>
  
  <p>Conversation class:</p>
  
  <pre><code>public class Conversation extends LinearLayout {
  
      private TextView id_tag_view;
  
      private TextView contact_name_view;
      private String contact_name;
  
      private TextView last_message_view;
      private String last_message;
  
      private ArrayList&lt;MessageContainer&gt; messageHistory;
  
      public Conversation(Context context) {
          super(context);
          init();
      }
  
      public Conversation(Context context, String contact_name, String last_message) {
          super(context);
          this.contact_name = contact_name;
          this.last_message = last_message;
          init();
      }
  
      public Conversation(Context context, @Nullable AttributeSet attrs) {
          super(context, attrs);
          init();
      }
  
      public Conversation(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
          super(context, attrs, defStyleAttr);
          init();
      }
  
      public Conversation(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
          super(context, attrs, defStyleAttr, defStyleRes);
          init();
      }
  
      private void init()
      {
          inflate(getContext(), R.layout.conversation_preview_view, this);
          this.contact_name_view = (TextView) findViewById(R.id.contact_name_textview);
          this.contact_name_view.setText(this.contact_name);
          this.last_message_view = (TextView) findViewById(R.id.last_message_textview);
          this.last_message_view.setText(this.last_message);
          this.id_tag_view = (TextView) findViewById(R.id.id_tag);
          this.messageHistory = new ArrayList&lt;MessageContainer&gt;();
      }
  
      public void setContactName(String name)
      {
          this.contact_name = name;
          this.contact_name_view.setText(this.contact_name);
          postInvalidate();
      }
  
      public void setLastMessage(String lastMessage)
      {
          this.last_message = lastMessage;
          this.last_message_view.setText(this.last_message);
          postInvalidate();
      }
  
      public void setConversationID(int id)
      {
          this.id_tag_view.setText(id + "");
      }
  
      public int getConversationID()
      {
          int id = Integer.parseInt(this.id_tag_view.getText().toString());
          return id;
      }
  
      public void addMessage(MessageContainer mc)
      {
          this.messageHistory.add(mc);
      }
  
      public ArrayList&lt;MessageContainer&gt; getMessageHistory()
      {
          return this.messageHistory;
      }
  
  }
  </code></pre>
  
  <p>Any help would be appreciated. Thanks.</p>