title: NoClassDefFoundError when using TabLayout
body: <p>I wanted to check out the new <a href="http://developer.android.com/reference/android/support/design/widget/TabLayout.html" rel="nofollow">TabLayout</a> from the <a href="http://android-developers.blogspot.de/2015/05/android-design-support-library.html" rel="nofollow">Android Design Support Layout</a>. </p>
  
  <p>The usage of the <code>TabLayout</code> is just </p>
  
  <pre><code>TabLayout tabLayout = (TabLayout) findViewById(R.id.tabLayout);
  </code></pre>
  
  <p>in Java and </p>
  
  <pre><code>&lt;TabLayout
      android:id="@+id/tabLayout"
      android:layout_width="match_parent"
      android:layout_height="wrap_content" /&gt;
  </code></pre>
  
  <p>This is my <code>build.gradle</code> file (simplified a little bit): </p>
  
  <pre><code>apply plugin: 'android'
  
  android {
      compileSdkVersion 22
      buildToolsVersion '22.0.1'
  
      defaultConfig {
          minSdkVersion 14
          targetSdkVersion 22        
  
          dexOptions {
              preDexLibraries = false
              javaMaxHeapSize "4g"
          }
  
      }
  
      dexOptions {
          preDexLibraries = false
      }
  }
  
  
  afterEvaluate {
      tasks.matching {
          it.name.startsWith('dex')
      }.each { dx -&gt;
          if (dx.additionalParameters == null) {
              dx.additionalParameters = ['--multi-dex']
          } else {
              dx.additionalParameters += '--multi-dex'
          }
      }
  }
  
  dependencies {
      compile fileTree(include: ['*.jar'], dir: 'libs')
      compile 'com.android.support:support-v13:22.2.0'
      compile 'com.google.android.gms:play-services-location:7.5.0'
      compile 'com.google.android.gms:play-services-base:7.5.0'
      compile 'com.google.android.gms:play-services-maps:7.5.0'
      compile 'com.google.android.gms:play-services-gcm:7.5.0'
      compile 'com.android.support:appcompat-v7:22.2.0'
      compile 'com.android.support:multidex:1.0.+'
      compile 'com.android.support:design:22.2.0'
  
  }
  </code></pre>
  
  <p>The <code>TabLayout</code> class is imported fine and the app compiles and starts, but when the Activity containing the <code>TabLayout</code> is opened I get the following exception: </p>
  
  <pre><code> Caused by: android.view.InflateException: Binary XML file line #13: Error inflating class TabLayout
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:757)
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
          at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:249)
          at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:106)
          at de.mycompany.myapp.ui.LoginRegisterActivity.onCreate(LoginRegisterActivity.java:25)
          at android.app.Activity.performCreate(Activity.java:5933)
          at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
              at android.app.ActivityThread.access$800(ActivityThread.java:144)
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
              at android.os.Handler.dispatchMessage(Handler.java:102)
              at android.os.Looper.loop(Looper.java:135)
              at android.app.ActivityThread.main(ActivityThread.java:5221)
              at java.lang.reflect.Method.invoke(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:372)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
   Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.TabLayout" on path: DexPathList[[zip file "/data/app/de.mycompany.myapp.debug-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
          at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
          at android.view.LayoutInflater.createView(LayoutInflater.java:571)
          at android.view.LayoutInflater.onCreateView(LayoutInflater.java:665)
          at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:65)
          at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682)
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741)
              at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
              at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
              at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
              at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
              at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
              at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:249)
              at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:106)
              at de.mycompany.myapp.ui.LoginRegisterActivity.onCreate(LoginRegisterActivity.java:25)
              at android.app.Activity.performCreate(Activity.java:5933)
              at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
              at android.app.ActivityThread.access$800(ActivityThread.java:144)
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
              at android.os.Handler.dispatchMessage(Handler.java:102)
              at android.os.Looper.loop(Looper.java:135)
              at android.app.ActivityThread.main(ActivityThread.java:5221)
              at java.lang.reflect.Method.invoke(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:372)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
  Suppressed: java.lang.ClassNotFoundException: android.view.TabLayout
          at java.lang.Class.classForName(Native Method)
          at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
          at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
          ... 27 more
   Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
  </code></pre>
  
  <p>Any ideas on what's going on there?</p>