title: androidx.preference.PreferenceScreen not found when creating Preferences screen
body: <p>After following <a href="https://developer.android.com/guide/topics/ui/settings/" rel="noreferrer">this tutorial</a> to create a screen for preferences, there seems to be a problem with inflating the class 'androidx.preference.PreferenceScreen'. Why is it not found when my preferences have been declared inside the <code>res/xml</code> folder and the necessary dependency has been added to this project? </p>
  
  <p>My app's minSdkVersion is 24.</p>
  
  <blockquote>
    <p>Error inflating class (not found)androidx.preference.PreferenceScreen</p>
  </blockquote>
  
  <p><strong>dependencies</strong></p>
  
  <pre><code>dependencies {
      implementation fileTree(dir: 'libs', include: ['*.jar'])
      implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
      implementation 'com.android.support:appcompat-v7:28.0.0'
      implementation 'com.android.support:cardview-v7:28.0.0'
      implementation 'com.android.support.constraint:constraint-layout:1.1.3'
      implementation 'com.android.support:preference-v7:28.0.0'
      implementation 'com.android.support:recyclerview-v7:28.0.0'
      implementation 'com.android.support:support-v4:28.0.0'
      testImplementation 'junit:junit:4.12'
      androidTestImplementation 'com.android.support.test:runner:1.0.2'
      androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
  }
  </code></pre>
  
  <p><strong>res/xml/preferences.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;androidx.preference.PreferenceScreen
      xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  
      &lt;CheckBoxPreference
          android:key="preference_a"
          android:defaultValue="false"
          android:title="Preference A" /&gt;
  
  &lt;/androidx.preference.PreferenceScreen&gt;
  </code></pre>
  
  <p><strong>Activity layout</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:id="@+id/settings_container"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"
      tools:context=".MySettingsActivity" /&gt;
  </code></pre>
  
  <p>Activity class</p>
  
  <pre><code>class MySettingsActivity : AppCompatActivity() {
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          supportFragmentManager
                  .beginTransaction()
                  .replace(R.id.settings_container, MySettingsFragment())
                  .commit()
      }
  }
  </code></pre>
  
  <p>Fragment class</p>
  
  <pre><code>class MySettingsFragment : PreferenceFragmentCompat() {
      override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
          addPreferencesFromResource(R.xml.app_preferences)
      }
  }
  </code></pre>