title: Binary XML file line #27: Error inflating class androidx.appcompat.widget.ActionBarContainer?
body: <p>I tried everything but cannot seem to solve this error. All the solutions I am finding are for pre-androidx codes. I think I added all dependencies needed, but it still would not work. I have also updated my android studio and all the dependencies to their most recent version. Any help would be appreciated. Below are code snippets from my Android Studio Project:</p>
  
  <p><strong>Logcat</strong></p>
  
  <pre><code>    --------- beginning of crash
  2019-11-06 16:01:16.819 5559-5559/com.example.scientificcalculator E/AndroidRuntime: FATAL EXCEPTION: main
      Process: com.example.scientificcalculator, PID: 5559
      java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.scientificcalculator/com.example.scientificcalculator.MainActivity}: android.view.InflateException: Binary XML file line #27: Binary XML file line #27: Error inflating class androidx.appcompat.widget.ActionBarContainer
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
          at android.app.ActivityThread.-wrap11(Unknown Source:0)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
          at android.os.Handler.dispatchMessage(Handler.java:105)
          at android.os.Looper.loop(Looper.java:164)
          at android.app.ActivityThread.main(ActivityThread.java:6541)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
       Caused by: android.view.InflateException: Binary XML file line #27: Binary XML file line #27: Error inflating class androidx.appcompat.widget.ActionBarContainer
       Caused by: android.view.InflateException: Binary XML file line #27: Error inflating class androidx.appcompat.widget.ActionBarContainer
       Caused by: java.lang.reflect.InvocationTargetException
          at java.lang.reflect.Constructor.newInstance0(Native Method)
          at java.lang.reflect.Constructor.newInstance(Constructor.java:334)
          at android.view.LayoutInflater.createView(LayoutInflater.java:647)
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
          at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
          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 androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:749)
          at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:659)
          at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:552)
          at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
          at com.example.scientificcalculator.MainActivity.onCreate(MainActivity.java:44)
          at android.app.Activity.performCreate(Activity.java:6975)
          at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
          at android.app.ActivityThread.-wrap11(Unknown Source:0)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
          at android.os.Handler.dispatchMessage(Handler.java:105)
          at android.os.Looper.loop(Looper.java:164)
          at android.app.ActivityThread.main(ActivityThread.java:6541)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
       Caused by: android.content.res.Resources$NotFoundException: Drawable android:color/primary_text_light with resource ID #0x1060003
       Caused by: android.content.res.Resources$NotFoundException: File res/color/primary_text_light.xml from drawable resource ID #0x1060003
          at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:768)
          at android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:600)
          at android.content.res.Resources.loadDrawable(Resources.java:885)
          at android.content.res.TypedArray.getDrawableForDensity(TypedArray.java:953)
          at android.content.res.TypedArray.getDrawable(TypedArray.java:928)
          at androidx.appcompat.widget.ActionBarContainer.&lt;init&gt;(ActionBarContainer.java:67)
  2019-11-06 16:01:16.825 5559-5559/com.example.scientificcalculator E/AndroidRuntime:     at java.lang.reflect.Constructor.newInstance0(Native Method)
          at java.lang.reflect.Constructor.newInstance(Constructor.java:334)
          at android.view.LayoutInflater.createView(LayoutInflater.java:647)
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
          at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
          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 androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:749)
          at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:659)
          at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:552)
          at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
          at com.example.scientificcalculator.MainActivity.onCreate(MainActivity.java:44)
          at android.app.Activity.performCreate(Activity.java:6975)
          at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
          at android.app.ActivityThread.-wrap11(Unknown Source:0)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
          at android.os.Handler.dispatchMessage(Handler.java:105)
          at android.os.Looper.loop(Looper.java:164)
          at android.app.ActivityThread.main(ActivityThread.java:6541)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
       Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #18: &lt;item&gt; tag requires a 'drawable' attribute or child tag defining a drawable
          at android.graphics.drawable.StateListDrawable.inflateChildElements(StateListDrawable.java:189)
          at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:122)
          at android.graphics.drawable.DrawableInflater.inflateFromXmlForDensity(DrawableInflater.java:142)
          at android.graphics.drawable.Drawable.createFromXmlInnerForDensity(Drawable.java:1295)
          at android.graphics.drawable.Drawable.createFromXmlForDensity(Drawable.java:1254)
          at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:758)
  
  </code></pre>
  
  <p><strong>Build.Gradle</strong></p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 29
      buildToolsVersion "29.0.2"
      defaultConfig {
          applicationId "com.example.scientificcalculator"
          minSdkVersion 15
          targetSdkVersion 29
          versionCode 1
          versionName "1.0"
          testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      implementation fileTree(include: ['*.jar'], dir: 'libs')
      implementation 'androidx.appcompat:appcompat:1.1.0'
      implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
      testImplementation 'junit:junit:4.12'
      androidTestImplementation 'androidx.test:runner:1.2.0'
      androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
      implementation files('libs/javaluator-3.0.3.jar')
  }
  </code></pre>
  
  <p><strong>Styles</strong></p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 29
      buildToolsVersion "29.0.2"
      defaultConfig {
          applicationId "com.example.scientificcalculator"
          minSdkVersion 15
          targetSdkVersion 29
          versionCode 1
          versionName "1.0"
          testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      implementation fileTree(include: ['*.jar'], dir: 'libs')
      implementation 'androidx.appcompat:appcompat:1.1.0'
      implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
      testImplementation 'junit:junit:4.12'
      androidTestImplementation 'androidx.test:runner:1.2.0'
      androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
      implementation files('libs/javaluator-3.0.3.jar')
  }
  </code></pre>
  
  <p><strong>Color</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;resources&gt;
      &lt;color name="calculator_background"&gt;#2196F3&lt;/color&gt;
      &lt;color name="calculator_foreground"&gt;#135ba3&lt;/color&gt;
      &lt;color name="calculator_color"&gt;#d9dfe4&lt;/color&gt;
      &lt;color name="calculator_screen"&gt;#d1e3e7&lt;/color&gt;
      &lt;color name="icons"&gt;#FFFFFF&lt;/color&gt;
      &lt;color name="divider"&gt;#B6B6B6&lt;/color&gt;
      &lt;color name="primary_text"&gt;#212121&lt;/color&gt;
  &lt;/resources&gt;
  </code></pre>