title: Android Studio 2.0 Instant Run causes DexFile to not load all classes
body: <p>I had some code to get a list of all the classes in a package that looked something like this:</p>
  
  <pre><code> try {
      DexFile df = new DexFile(context.getPackageCodePath());
      for (Enumeration&lt;String&gt; iter = df.entries(); iter.hasMoreElements();) {
          String s = iter.nextElement();
      }
  } catch (IOException e) {
      e.printStackTrace();
  }
  </code></pre>
  
  <p>However this code has stopped working since I upgraded my Android Studio to version 2.0. I've found that the culprit is Instant Run. If I debug the app I can see that without instance run, the DexFile variable, df, contains a list of class names (over 4,000 of them). When Instant Run is turned on, I only get like 30 or so class names, and the classes that I'm looking for aren't there. I have a feeling it has something to do with multi dex but I'm not sure how Instant Run is working under the covers (my app does not use multidex).</p>
  
  <p>Does anyone know how I can get a list of classes like this with Instant Run turned on? Or does anyone know exactly why Im seeing this behaviour (would be great to understand it)?</p>