title: google gson LinkedTreeMap class cast to myclass
body: <p>I knew this question has been asked before. Due to my novice skill in java and android. I can't resolve this issue for more than a week. </p>
  
  <p>One of my friend and i developing an android project were there are a couple of things like this. </p>
  
  <p>The most weird part of this things is, it's happening only from when i download and test it from Google play store. Not from local android studio installation or debug mode. </p>
  
  <p>What could be the problem here, or this returning list which is totally wrong ?
  My friend convincing that this code returns correctly but from play store installation it's always an error. </p>
  
  <p>Please suggest me where should i keep digging?</p>
  
  <pre><code>@Override
  public void promiseMethod(JSONObject object) {
      if (object != null) {
  
          if (object.has(DO_SERVICES)) {
              vehicleDetails = new ArrayList &lt; Object[] &gt; (1);
              List &lt; String &gt; vehicleNoList = new ArrayList &lt; String &gt; (1);
              List &lt; String &gt; serviceList = new ArrayList &lt; String &gt; (1);
              try {
                  Gson gson = new Gson();
                  JSONObject jsonObj = new JSONObject(object.get(DO_SERVICES)
                      .toString());
                  servDto = gson.fromJson(jsonObj.toString(),
                      ServiceDto.class);
  
  
                  if (servDto.getServiceDto() instanceof List) {
  
                      List &lt; DoServiceDto &gt; doServiceList = servDto.getServiceDto();
  </code></pre>
  
  <p>Exception is </p>
  
  <blockquote>
    <p>java.lang.ClassCastException: com.google.gson.internal.LinkedTreeMap           cannot be cast to com.gaurage.dto.DoServiceDto
      at com.gaurage.user.User_Test_Main.promiseMethod(Unknown Source)</p>
  </blockquote>