title: Can't debug fragments on android studio
body: <p>I'm using Android-Studio and since last week I couldn't stop at any break point set to any <code>fragment</code>.
  If I put a break point in the activity, the debugger breaks as expected.
  If the debugger comes to a line like: <code>MyFragment f = new MyFragment();</code> or any line with a reference to a fragment, and I press "Step into" the debugge<code>performs the actions but I still see the debugger stands on the line</code>MyFragment f = new MyFragment();`</p>
  
  <p>Moreover, I noticed that I get a messages like this in the Debug section:</p>
  
  <pre><code>fragment = No such static field: 'fragment'
  chgPicBtn = No such instance field: 'chgPicBtn'
  </code></pre>
  
  <p>I don't know if it's related but it was worth mentioning.</p>
  
  <p>I've been looking for similar problem online and found nothing.
  Thanks for the help</p>
  
  <p>Edit:
  This is a function that calls the activity:</p>
  
  <pre><code>public void displayView(int position) {
  
      String tag = "";
      fragment = null;
      switch (position) {
          case 0:
              fragment = new NewFragmentMain();
              if (chgPicBtn != null)
                  chgPicBtn.setVisibility(View.GONE);
              tag = "NewFragmentMain";
              break;
          case 1:
              fragment = EditProfileFragment.newInstance(!bool);
              tag = "EditProfileFragment";
              if (chgPicBtn != null)
                  chgPicBtn.setVisibility(View.VISIBLE);
              break;
          ...
          default:
              break;
      }
  
      if (fragment != null) {
          FragmentManager fragmentManager = getSupportFragmentManager();
          FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
          fragmentTransaction.replace(R.id.container_body, fragment, tag);
          fragmentTransaction.addToBackStack(tag).commit();
      }
  }
  </code></pre>
  
  <p>The constructor of NewFragmentMain is empty.</p>
  
  <p>EDIT:</p>
  
  <p>The problem was due to:</p>
  
  <pre><code>debug {
          minifyEnabled true
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
      }
  </code></pre>
  
  <p>in the gradle file.
  I turned it to false and everything worked.</p>