title: Using .aar NoClassDefFoundError But Class Exists and is Dexed
body: <p>I have several projects which I build to create an .aar. I then import this .aar into into Android Studio under /libs. The build.gradle file for this dependency looks as follows:</p>
  
  <pre><code>repositories{
      flatDir{
          dirs 'libs'
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      compile 'com.android.support:appcompat-v7:22.0.0'
      compile 'com.google.android.gms:play-services:7.0.0'
      compile 'com.android.support:multidex:+'
      compile(name: 'customApi-debug', ext:'aar')
  }
  </code></pre>
  
  <p>Since the library is quite large I have set multiDexEnabled = true. Android Studio finds the library and autocomplete works. Building works fine too but running the app gives the following error:</p>
  
  <pre><code>java.lang.NoClassDefFoundError: com.companyx.android.api.ui.vision.metaio.MetaIoView
              at com.companyx.android.api.ui.vision.metaio.MetaIoView$$InjectAdapter.&lt;init&gt;(MetaIoView$$InjectAdapter.java:29)
  </code></pre>
  
  <p>I uncompressed and disassembled the .aar and dex files, respectively, and verified that the classes its complaining about actually exist. I've tried existing approaches for dealing with this problem but none of them worked.</p>
  
  <p>Anyone else experienced this? Thanks in advance. </p>