title: Error inflating class android.support.v7.widget.Toolbar in Android
body: <p>I'ved looked at a ton of SO questions and tried implementing them.  Can't seem to figure this one one, it was working yesterday, but not anymore.</p>
  
  <p>gradle:</p>
  
  <pre><code>android {
  compileSdkVersion 23
  buildToolsVersion "23.0.0 "
  
  dexOptions {
      javaMaxHeapSize "4g"
  }
  
  defaultConfig {
      minSdkVersion 16
      multiDexEnabled true
      targetSdkVersion 23
  }
  dependencies {
  compile 'com.android.support:appcompat-v7:23.0.0'
  compile 'com.android.support:cardview-v7:23.0.0'
  compile 'com.android.support:design:23+'
  compile 'com.android.support:multidex:1.0.1'
  compile 'com.android.support:recyclerview-v7:23.0.0'
  compile 'com.android.support:support-v4:24.0.0-alpha2'
  compile 'com.github.fernandodev.easyratingdialog:easyratingdialog:1.1.0'
  compile 'com.google.android.gms:play-services:8.1.0'
  compile 'com.google.code.gson:gson:2.3.1'
  compile 'com.parse.bolts:bolts-android:1.+'
  compile 'com.parse:parse-android:1.+'
  compile 'com.squareup:otto:1.3.8'
  compile 'com.moengage:moe-android-sdk:6.0.10'
  compile 'com.amazonaws:aws-android-sdk-mobileanalytics:2.2.9'
  
  
  compile 'org.apmem.tools:layouts:1.9@aar'
  
  compile fileTree(dir: 'libs', include: ['*.jar'])
  compile('com.crashlytics.sdk.android:answers:1.3.6@aar') {
      transitive = true;
  }
  compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
      transitive = true;
  }
  }
  </code></pre>
  
  <p>toolbar.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  </code></pre>
  
  <p>
  
  <pre><code>android:background="@color/colorPrimary"
  android:elevation="4dp"
  android:layout_height="wrap_content"
  android:layout_width="match_parent"
  android:minHeight="@dimen/abc_action_bar_default_height_material"
  android:theme="@style/ThemeOverlay.AppCompat.Dark"/&gt;
  </code></pre>
  
  <p>BaseActivity.class</p>
  
  <pre><code>public abstract class BaseActivity extends AppCompatActivity {
  private MoEHelper mHelper;
  public static MobileAnalyticsManager analytics;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      mHelper = new MoEHelper(this);
  
  
      try {
          analytics = MobileAnalyticsManager.getOrCreateInstance(
                  this.getApplicationContext(),
                  "", //Amazon Mobile Analytics App ID
                  "" //Amazon Cognito Identity Pool ID
          );
      } catch(InitializationException ex) {
          Log.e(this.getClass().getName(), "Failed to initialize Amazon Mobile Analytics", ex);
      }
  
  
  
  }
  
  @Override
  protected void onStart() {
      super.onStart();
      mHelper.onStart(this);
  }
  
  @Override
  protected void onStop() {
      super.onStop();
      mHelper.onStop(this);
  
  
  }
  
  @Override
  protected void onPause() {
      super.onPause();
      mHelper.onPause(this);
      if(analytics != null) {
          analytics.getSessionClient().pauseSession();
          //Attempt to send any events that have been recorded to the Mobile Analytics service.
          analytics.getEventClient().submitEvents();
      }
  }
  
  @Override
  protected void onResume() {
      super.onResume();
      mHelper.onResume(this);
      if(analytics != null)  {
          analytics.getSessionClient().resumeSession();
      }
  }
  
  @Override
  protected void onSaveInstanceState(Bundle outState) {
      super.onSaveInstanceState(outState);
      mHelper.onSaveInstanceState(outState);
  }
  
  @Override
  protected void onRestoreInstanceState(Bundle savedInstanceState) {
      super.onRestoreInstanceState(savedInstanceState);
      mHelper.onRestoreInstanceState(savedInstanceState);
  }
  
  @Override
  protected void onNewIntent(Intent intent) {
      super.onNewIntent(intent);
      mHelper.onNewIntent(this, intent);
  }
  }
  </code></pre>
  
  <p>Activity class</p>
  
  <pre><code>public abstract class Activity extends BaseActivity
  {
  protected Toolbar toolbar;
  
  // region Activity Lifecycle
  
  @Override
  protected void onCreate(Bundle savedInstanceState)
  {
      super.onCreate(savedInstanceState);
      setContentView(getContentView());
  
      toolbar = (Toolbar) findViewById(R.id.toolbar);
      if (toolbar != null)
      {
          setSupportActionBar(toolbar);
      }
  }
  
  // endregion
  
  // region Getters/Setters
  
  protected String getActionBarTitle()
  {
      String actionBarTitle = "";
  
      ActionBar actionBar = getSupportActionBar();
      if (actionBar != null &amp;&amp; actionBar.getTitle() != null)
      {
          actionBarTitle = actionBar.getTitle().toString();
      }
  
      return actionBarTitle;
  }
  
  protected void setActionBarTitle(int resourceId)
  {
      String actionBarTitle = getString(resourceId);
      setActionBarTitle(actionBarTitle);
  }
  
  protected void setActionBarTitle(String actionBarTitle)
  {
      ActionBar actionBar = getSupportActionBar();
      if (actionBar != null)
      {
          if (!StringUtilities.isNullOrEmpty(actionBarTitle))
          {
  
              SpannableString spannableString = new SpannableString(actionBarTitle);
              spannableString.setSpan(new TypefaceSpan("sans-serif-light"), 0, spannableString.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
  
              actionBar.setTitle(spannableString);
              actionBar.setDisplayShowTitleEnabled(true);
          }
          else
          {
              actionBar.setDisplayShowTitleEnabled(false);
          }
      }
  }
  
  // endregion
  
  abstract protected int getContentView();
  }
  </code></pre>
  
  <p>Activity_main.xml</p>
  
  <p>Logcat</p>
  
  <pre><code>Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class android.support.v7.widget.Toolbar
          at android.view.LayoutInflater.createView(LayoutInflater.java:640)
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:750)
          at android.view.LayoutInflater.parseInclude(LayoutInflater.java:904)
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:821)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:366)
          at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:280)
          at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
          at com.app.Activity.onCreate(Activity.java:24)
          at com.app.DrawerActivity.onCreate(DrawerActivity.java:51)
          at com.app.MainActivity.onCreate(MainActivity.java:86)
          at android.app.Activity.performCreate(Activity.java:6221)
          at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2614)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
          at android.app.ActivityThread.access$900(ActivityThread.java:172)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421)
          at android.os.Handler.dispatchMessage(Handler.java:102)
          at android.os.Looper.loop(Looper.java:145)
          at android.app.ActivityThread.main(ActivityThread.java:5835)
          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:1388)
          at     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)
  </code></pre>