title: Android error: Can't find ColorStateList from drawable resource while using dialogs
body: <p>I'm trying to give a test to the new Android Material libraries but after hours and hours of investigate I can't figure out how to fix this problem.</p>
  
  <p>The error happens when I try to open any kind of dialog.</p>
  
  <p>This is the error</p>
  
  <blockquote>
    <p>android.content.res.Resources$NotFoundException: Can't find
    ColorStateList from drawable resource ID #0x7f070018
            at android.content.res.ResourcesImpl.loadColorStateList(ResourcesImpl.java:1042)
            at android.content.res.Resources.loadColorStateList(Resources.java:1041)
            at android.content.res.TypedArray.getColor(TypedArray.java:469)
            at com.android.internal.policy.PhoneWindow.generateLayout(PhoneWindow.java:2436)
            at com.android.internal.policy.PhoneWindow.installDecor(PhoneWindow.java:2672)
            at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:410)
            at com.android.internal.app.AlertController.installContent(AlertController.java:263)
            at android.app.AlertDialog.onCreate(AlertDialog.java:436)
            at android.app.Dialog.dispatchOnCreate(Dialog.java:407)
            at android.app.Dialog.show(Dialog.java:302)</p>
  </blockquote>
  
  <p>The resource with ID #0x7f070018 resolves to abc_dialog_material_background which is part of the appcompat library.</p>
  
  <p>This is the code invoking the error</p>
  
  <pre><code>val c = Calendar.getInstance()
          val year = c.get(Calendar.YEAR)
          val month = c.get(Calendar.MONTH)
          val day = c.get(Calendar.DAY_OF_MONTH)
  
          DatePickerDialog(requireContext(), DatePickerDialog.OnDateSetListener { _, y, m, dayOfMonth -&gt;
              println(y)
              println(m)
              println(dayOfMonth)
          }, year, month, day).show()
  </code></pre>
  
  <p>This is my module build.gradle file</p>
  
  <pre><code>apply plugin: 'com.android.application'
  apply plugin: 'kotlin-android'
  apply plugin: 'kotlin-android-extensions'
  apply plugin: 'kotlin-kapt'
  apply plugin: 'androidx.navigation.safeargs'
  
  android {
      compileSdkVersion rootProject.compileSdkVersion
      buildToolsVersion '28.0.2'
  
      dataBinding {
          enabled = true
      }
  
      defaultConfig {
          applicationId 'moe.anekoisfinetoo.peek'
          minSdkVersion rootProject.minSdkVersion
          targetSdkVersion rootProject.targetSdkVersion
          versionCode 1000
          versionName '0.1.0'
          testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
      }
  
      buildTypes {
          release {
              minifyEnabled true
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_8
          targetCompatibility JavaVersion.VERSION_1_8
      }
  }
  
  dependencies {
      /* Any jar files */
      implementation fileTree(dir: 'libs', include: ['*.jar'])
  
      /* Android Constraint Layout
       * https://developer.android.com/training/constraint-layout/index.html */
      implementation "androidx.constraintlayout:constraintlayout:$rootProject.constraintLayoutVersion"
  
      /* Android KTX
       * https://developer.android.com/kotlin/ktx */
      implementation "androidx.core:core-ktx:$rootProject.ktxVersion"
  
      /* Android Lifecycle Libraries
       * https://developer.android.com/topic/libraries/architecture/lifecycle */
      implementation "androidx.lifecycle:lifecycle-extensions:$rootProject.lifecycleExtensionsVersion"
  
      /* Android Material Components
       * https://github.com/material-components/material-components-android */
      implementation "com.google.android.material:material:$rootProject.materialVersion"
  
      /* Android Navigation
       * https://developer.android.com/topic/libraries/architecture/navigation */
      implementation "android.arch.navigation:navigation-fragment-ktx:$rootProject.navigationVersion"
      implementation "android.arch.navigation:navigation-ui-ktx:$rootProject.navigationVersion"
      androidTestImplementation "android.arch.navigation:navigation-testing-ktx:$rootProject.navigationVersion"
  
      /* Android Support Libraries
       * https://developer.android.com/topic/libraries/support-library/index.html */
      implementation "androidx.appcompat:appcompat:$rootProject.appCompatVersion"
  
      /* Kotlin
       * https://kotlinlang.org/ */
      implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$rootProject.kotlinVersion"
  
      /* Material Dialogs
       * https://github.com/afollestad/material-dialogs */
      implementation "com.afollestad.material-dialogs:core:$rootProject.materialDialogs"
  
      /* Testing */
      testImplementation "junit:junit:$rootProject.junitVersion"
      androidTestImplementation "androidx.test:runner:$rootProject.runnerVersion"
      androidTestImplementation "androidx.test.espresso:espresso-core:$rootProject.espressoCoreVersion"
  }
  </code></pre>
  
  <p>All versions are retrieved from project build.gradle and are up-to-date.</p>