title: Android SnackBar: error inflating SnackbarLayout
body: <p>I wanted to try out the new Snackbar from the official design library provided by Google. Its usage is very close to a Toast so I thought it would be simple enough to try out.</p>
  
  <p>I've tried it out on an emulator running 5.1 as well as Samsung Galaxy S6 Edge running 5.0.</p>
  
  <p>My problem is that the app crashes when it's supposed to display the Snackbar.</p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>package com.jayway.andreas.test;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.support.design.widget.Snackbar;
  import android.view.View;
  
  
  public class MainActivity extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          findViewById(R.id.button).setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  Snackbar.make(v, R.string.test, Snackbar.LENGTH_LONG)
                          .setAction("Action!", new View.OnClickListener() {
                              @Override
                              public void onClick(View v) {
                                  // NOP
                              }
                          })
                          .show();
              }
          });
      }
  }
  </code></pre>
  
  <p><strong>Layout:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout
      android:id="@+id/root_layout"
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:paddingBottom="@dimen/activity_vertical_margin"
      android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingTop="@dimen/activity_vertical_margin"
      tools:context=".MainActivity"&gt;
  
      &lt;Button
          android:id="@+id/button"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentTop="true"
          android:layout_centerHorizontal="true"
          android:text="Button"/&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><strong>Gradle file</strong></p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 22
      buildToolsVersion "23.0.0 rc1"
  
      defaultConfig {
          applicationId "com.jayway.andreas.test"
          minSdkVersion 21
          targetSdkVersion 22
          versionCode 1
          versionName "1.0"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_7
          targetCompatibility JavaVersion.VERSION_1_7
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      compile 'com.android.support:design:22.2.0'
  }
  </code></pre>
  
  <p>I have tried providing different views(root RelativeLayout, view of button and the window's decor view) as the first parameter, but no matter which one I've provided I still get the following stacktrace:</p>
  
  <pre><code>android.view.InflateException: Binary XML file line #18: Error inflating class android.support.design.widget.Snackbar$SnackbarLayout
  E/AndroidRuntime(19107):    at android.view.LayoutInflater.createView(LayoutInflater.java:640)
  E/AndroidRuntime(19107):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:750)
  E/AndroidRuntime(19107):    at android.view.LayoutInflater.inflate(LayoutInflater.java:483)
  E/AndroidRuntime(19107):    at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
  E/AndroidRuntime(19107):    at android.support.design.widget.Snackbar.&lt;init&gt;(Snackbar.java:119)
  E/AndroidRuntime(19107):    at android.support.design.widget.Snackbar.make(Snackbar.java:140)
  E/AndroidRuntime(19107):    at android.support.design.widget.Snackbar.make(Snackbar.java:164)
  E/AndroidRuntime(19107):    at com.jayway.andreas.test.MainActivitykr8.51onClick(MainActivity.java:20)
  E/AndroidRuntime(19107):    at android.view.View.performClick(View.java:5217)
  E/AndroidRuntime(19107):    at android.view.View$PerformClick.run(View.java:20983)
  E/AndroidRuntime(19107):    at android.os.Handler.handleCallback(Handler.java:739)
  E/AndroidRuntime(19107):    at android.os.Handler.dispatchMessage(Handler.java:95)
  E/AndroidRuntime(19107):    at android.os.Looper.loop(Looper.java:145)
  E/AndroidRuntime(19107):    at android.app.ActivityThread.main(ActivityThread.java:6141)
  E/AndroidRuntime(19107):    at java.lang.reflect.Method.invoke(Native Method)
  E/AndroidRuntime(19107):    at java.lang.reflect.Method.invoke(Method.java:372)
  E/AndroidRuntime(19107):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
  E/AndroidRuntime(19107):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
  E/AndroidRuntime(19107): Caused by: java.lang.reflect.InvocationTargetException
  E/AndroidRuntime(19107):    at java.lang.reflect.Constructor.newInstance(Native Method)
  E/AndroidRuntime(19107):    at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
  E/AndroidRuntime(19107):    at android.view.LayoutInflater.createView(LayoutInflater.java:614)
  E/AndroidRuntime(19107):    ... 17 more
  E/AndroidRuntime(19107): Caused by: android.view.InflateException: Binary XML file line #34: Error inflating class &lt;unknown&gt;
  E/AndroidRuntime(19107):    at android.view.LayoutInflater.createView(LayoutInflater.java:640)
  E/AndroidRuntime(19107):    at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55)
  E/AndroidRuntime(19107):    at android.view.LayoutInflater.onCreateView(LayoutInflater.java:689)
  E/AndroidRuntime(19107):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:748)
  E/AndroidRuntime(19107):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
  E/AndroidRuntime(19107):    at android.view.LayoutInflater.inflate(LayoutInflater.java:480)
  E/AndroidRuntime(19107):    at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
  E/AndroidRuntime(19107):    at android.view.LayoutInflater.inflate(LayoutInflater.java:366)
  E/AndroidRuntime(19107):    at android.support.design.widget.Snackbar$SnackbarLayout.&lt;init&gt;(Snackbar.java:526)
  E/AndroidRuntime(19107):    ... 20 more
  E/AndroidRuntime(19107): Caused by: java.lang.reflect.InvocationTargetException
  E/AndroidRuntime(19107):    at java.lang.reflect.Constructor.newInstance(Native Method)
  E/AndroidRuntime(19107):    at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
  E/AndroidRuntime(19107):    at android.view.LayoutInflater.createView(LayoutInflater.java:614)
  E/AndroidRuntime(19107):    ... 28 more
  E/AndroidRuntime(19107): Caused by: java.lang.RuntimeException: Failed to resolve attribute at index 13
  E/AndroidRuntime(19107):    at android.content.res.TypedArray.getDrawable(TypedArray.java:760)
  E/AndroidRuntime(19107):    at android.view.View.&lt;init&gt;(View.java:3990)
  E/AndroidRuntime(19107):    at android.widget.TextView.&lt;init&gt;(TextView.java:1021)
  E/AndroidRuntime(19107):    at android.widget.TextView.&lt;init&gt;(TextView.java:1016)
  E/AndroidRuntime(19107):    at android.widget.TextView.&lt;init&gt;(TextView.java:1012)
  E/AndroidRuntime(19107):    ... 31 more
  </code></pre>