title: Failing to inflate layout : Failed to resolve attribute at index
body: <p>I'm getting an error when running my app in the emulator: it narrowed it down to the Toolbar layout I'm using, but I can't put my finger on the exact reason.. something about the style I'm using?</p>
  
  <p>This is the output when running the app:</p>
  
  <pre><code>android.view.InflateException: Binary XML file line #12: Failed to resolve attribute at index 6: TypedValue{t=0x1c/d=0xff212121 a=2 r=0x7f0c0049}
      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
      at android.app.ActivityThread.-wrap11(ActivityThread.java)                                                                                     
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)                                                                                     
      at android.os.Handler.dispatchMessage(Handler.java:102)                                                                                     
      at android.os.Looper.loop(Looper.java:148)                                                                                     
      at android.app.ActivityThread.main(ActivityThread.java:5417)                                                                                     
      at java.lang.reflect.Method.invoke(Native Method)                                                                     
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)                                                                                     
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)                                                                                  
  Caused by: android.view.InflateException: Binary XML file line #12: Failed to resolve attribute at index 6: TypedValue{t=0x1c/d=0xff212121 a=2 r=0x7f0c0049}                                                                                     
      at android.view.LayoutInflater.inflate(LayoutInflater.java:539)                                                                                     
      at android.view.LayoutInflater.inflate(LayoutInflater.java:423)                                                                                     
      at android.view.LayoutInflater.inflate(LayoutInflater.java:374)                                                                                     
      at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:276)                                                                                     
      at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)                                                                                     
      at com.fontaine.nick.touchevents.MainActivity.onCreate(MainActivity.java:61)                                                                                     
      at android.app.Activity.performCreate(Activity.java:6237)                                                                                     
      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)                                                                                     
      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)                                                                                     
      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)                                                                                      
      at android.app.ActivityThread.-wrap11(ActivityThread.java)                                                                                      
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)                                                                                      
      at android.os.Handler.dispatchMessage(Handler.java:102)                                                                                      
      at android.os.Looper.loop(Looper.java:148)                                                                                      
      at android.app.ActivityThread.main(ActivityThread.java:5417)                                                                                      
      at java.lang.reflect.Method.invoke(Native Method)                                                                                      
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)                                                                                      
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)                                                                                   
  Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 6: TypedValue{t=0x1c/d=0xff212121 a=2 r=0x7f0c0049}                                                                                     
      at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:705)                                                                                     
      at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:6890)                                                                                     
      at android.view.ViewGroup$MarginLayoutParams.&lt;init&gt;(ViewGroup.java:7071)                                                                                     
      at android.widget.LinearLayout$LayoutParams.&lt;init&gt;(LinearLayout.java:1911)                                                                                     
      at android.support.design.widget.AppBarLayout$LayoutParams.&lt;init&gt;(AppBarLayout.java:558)                                                                                     
      at android.support.design.widget.AppBarLayout.generateLayoutParams(AppBarLayout.java:283)                                                                                     
      at android.support.design.widget.AppBarLayout.generateLayoutParams(AppBarLayout.java:97)                                                                                     
      at android.view.LayoutInflater.rInflate(LayoutInflater.java:837)                                                                                     
      at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)                                                                                     
      at android.view.LayoutInflater.rInflate(LayoutInflater.java:838)                                                                                     
      at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)                                                                                     
      at android.view.LayoutInflater.inflate(LayoutInflater.java:515)                                                                                     
      at android.view.LayoutInflater.inflate(LayoutInflater.java:423)                                                                                      
      at android.view.LayoutInflater.inflate(LayoutInflater.java:374)                                                                                      
      at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:276)                                                                                      
      at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)                                                                                      
      at com.fontaine.nick.touchevents.MainActivity.onCreate(MainActivity.java:61)                                                                                      
      at android.app.Activity.performCreate(Activity.java:6237)                                                                                      
      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)                                                                                      
      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)                                                                                      
      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)                                                                                      
      at android.app.ActivityThread.-wrap11(ActivityThread.java)                                                                                      
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)                                                                                      
      at android.os.Handler.dispatchMessage(Handler.java:102)                                                                                      
      at android.os.Looper.loop(Looper.java:148)                                                                                      
      at android.app.ActivityThread.main(ActivityThread.java:5417)                                                                                      
      at java.lang.reflect.Method.invoke(Native Method)                                                                                      
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)                                                                                      
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
  </code></pre>
  
  <p>my hoofdscherm.xml (main layout that gets inflated):</p>
  
  <pre><code>&lt;android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:id="@+id/coordinaterlayout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;android.support.design.widget.AppBarLayout
          android:id="@+id/appbar"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"&gt;
  
          &lt;android.support.v7.widget.Toolbar
              android:id="@+id/toolbar"
              android:layout_width="match_parent"
              android:layout_height="?attr/actionBarSize"
              android:background="?attr/colorPrimary"
              android:theme="@style/Theme.AppCompat.NoActionBar"
              app:layout_scrollFlags="scroll|enterAlways|snap"&gt;
          &lt;/android.support.v7.widget.Toolbar&gt;
  
      &lt;/android.support.design.widget.AppBarLayout&gt;
  
      &lt;android.support.v4.widget.SwipeRefreshLayout
          android:id="@+id/swiperefresh"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:animateLayoutChanges="true"
          app:layout_behavior="@string/appbar_scrolling_view_behavior"&gt;
  
          &lt;android.support.v7.widget.RecyclerView
              android:id="@+id/aandelenlijst"
              android:layout_width="match_parent"
              android:layout_height="match_parent"&gt;
  
          &lt;/android.support.v7.widget.RecyclerView&gt;
      &lt;/android.support.v4.widget.SwipeRefreshLayout&gt;
  
      &lt;android.support.design.widget.FloatingActionButton
          android:id="@+id/fab"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:elevation="6dp"
          android:onClick="showInputDialog"
          android:src="@drawable/ic_action_add"
          app:layout_anchor="@id/toolbar"
          app:layout_anchorGravity="end|bottom" /&gt;
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p>my styles.xml: 
      </p>
  
  <pre><code>    &lt;style name="MyMaterialTheme" parent="MyMaterialTheme.Base"&gt;
  
      &lt;/style&gt;
  
      &lt;style name="MyMaterialTheme.Base" parent="ThemeOverlay.AppCompat.Dark.ActionBar"&gt;
          &lt;item name="windowNoTitle"&gt;true&lt;/item&gt;
          &lt;item name="windowActionBar"&gt;false&lt;/item&gt;
          &lt;item name="colorPrimary"&gt;@color/colorPrimary&lt;/item&gt;
          &lt;item name="colorPrimaryDark"&gt;@color/colorPrimaryDark&lt;/item&gt;
          &lt;item name="colorAccent"&gt;@color/colorAccent&lt;/item&gt;
      &lt;/style&gt;
  
  &lt;/resources&gt;
  </code></pre>
  
  <p>the build.gradle :</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 23
      buildToolsVersion "23.0.3"
  
      defaultConfig {
          applicationId "com.fontaine.nick.touchevents"
  
          minSdkVersion 21 //stond intiaal op 15, mss rollbacken indien problemen
          targetSdkVersion 23
          versionCode 1
          versionName "1.0"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      testCompile 'junit:junit:4.12'
  
      compile 'com.android.support:appcompat-v7:23.2.1'
      compile 'com.android.support:cardview-v7:23.2.1'
      compile 'com.android.support:recyclerview-v7:23.2.1'
      compile 'com.android.support:design:23.2.1'
  
      //compile 'com.android.support:support-v4:23.1.1'
      //compile 'com.android.support:design:23.0.1'
      compile 'com.google.android.gms:play-services:8.4.0'
      compile 'com.github.brnunes:swipeablerecyclerview:1.0.2' //voor de cardviews te swipen
  }
  </code></pre>
  
  <p>MainActivity:</p>
  
  <p>public class MainActivity extends AppCompatActivity {</p>
  
  <pre><code>//de arraylist van strings waarin we de aandelen gaan opslaan die de gebruiker gekozen heeft
  ArrayList&lt;String&gt; Aandelenlijst = new ArrayList&lt;String&gt;();
  
  //de arraylist van Stock-objecten waarin de return van de yahoo finance-"get" zal zitten
  ArrayList&lt;Stock&gt; mDataSet = new ArrayList&lt;Stock&gt;();
  
  //de Adapter die de bepaalde elementen van de view zal binden aan de desbetreffende properties van de class
  StockAdapter adapterke = new StockAdapter(mDataSet);
  
  //handle creëren voor de swiperefreshlayout
  SwipeRefreshLayout mSwipeRefreshLayout;
  
  //handle creëren voor de coordinaterlayout
  CoordinatorLayout coordinatorLayout;
  
  RecyclerView recyclerView;
  
  //connectie makne met DB
  StockQuotesDB db = new StockQuotesDB(this);
  StringBuilder sb = new StringBuilder();
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
  
  
      super.onCreate(savedInstanceState);
      setContentView(R.layout.hoofdscherm);
  
      //recyclerview stuff goedzetten
      recyclerView = (RecyclerView) findViewById(R.id.aandelenlijst);
      recyclerView.setHasFixedSize(true);
      LinearLayoutManager layoutManager = new LinearLayoutManager(this);
      recyclerView.setLayoutManager(layoutManager);
      recyclerView.setAdapter(adapterke);
      recyclerView.setItemAnimator(new DefaultItemAnimator());
  
  
      //apptoolbar goedzetten
  
      Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
      setSupportActionBar(toolbar);
  
      final ActionBar ab = getSupportActionBar();
      ab.setDisplayHomeAsUpEnabled(true);
  </code></pre>