title: Error inflating class com.google.android.material.slider.Slider
body: <p>I want to inflate a layout containing a single seekBar. in this way, I've created a java class that extends fragment class and then I inflate the layout. but the following error occurred:</p>
  <p>Binary XML file line #9: Binary XML file line #9: Error inflating class com.google.android.material.slider.Slider</p>
  <pre><code>warming.XML is in the following:
  
      &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;RelativeLayout
      xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;&gt;
  
      &lt;com.google.android.material.slider.Slider
          android:layout_width=&quot;327dp&quot;
          android:layout_height=&quot;37dp&quot;
          android:layout_alignParentStart=&quot;true&quot;
          android:layout_alignParentTop=&quot;true&quot;
          android:layout_alignParentEnd=&quot;true&quot;
          android:layout_alignParentBottom=&quot;true&quot;
          android:layout_marginStart=&quot;42dp&quot;
          android:layout_marginTop=&quot;217dp&quot;
          android:layout_marginEnd=&quot;42dp&quot;
          android:layout_marginBottom=&quot;349dp&quot;
          android:valueFrom=&quot;0&quot;
          android:valueTo=&quot;300&quot;
          app:activeTrackColor=&quot;#ff4500&quot;
          app:inactiveTrackColor=&quot;#fbb999&quot; &gt;
  
      &lt;/com.google.android.material.slider.Slider&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  <p>and firstPage.java that inflate layout warming.XML is in the following:</p>
  <pre><code>public class firstPage extends Fragment {
     @Nullable
     @Override
     public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return inflater.inflate(R.layout.warming,container,false);
     }
  }
  </code></pre>
  <p>using the following code, I want to execute the firstPage.java class:</p>
  <pre><code>getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container,new firstPage()).commit();
  </code></pre>
  <p>what's the matter? can anyone help me? I've searched for this problem in StackOverflow and some other websites, and there were similar questions but no one can solve my problem.</p>
  <p><strong>Update</strong></p>
  <p>full Stack Trace is here:</p>
  <pre><code>04-16 12:45:37.991 18832-18832/? I/art: Late-enabling -Xcheck:jni
  04-16 12:45:37.991 18832-18832/? I/art: VMHOOK: rlim_cur : 0 pid:18832
  04-16 12:45:38.132 18832-18832/com.example.myapplication W/System: ClassLoader referenced unknown path: /data/app/com.example.myapplication-2/lib/arm
  04-16 12:45:38.443 18832-18832/com.example.myapplication W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
  04-16 12:45:38.513 18832-18832/com.example.myapplication I/art: Rejecting re-init on previously-failed class java.lang.Class&lt;androidx.core.view.ViewCompat$2&gt;
  04-16 12:45:38.513 18832-18832/com.example.myapplication I/art: Rejecting re-init on previously-failed class java.lang.Class&lt;androidx.core.view.ViewCompat$2&gt;
  04-16 12:45:38.914 18832-18848/com.example.myapplication I/Adreno-EGL: &lt;qeglDrvAPI_eglInitialize:379&gt;: EGL 1.4 QUALCOMM build: Nondeterministic_AU_msm8974_LA.BF.1.1.3__release_AU (I3fa967cfef)
      OpenGL ES Shader Compiler Version: E031.28.00.02
      Build Date: 09/29/15 Tue
      Local Branch: mybranch14683032
      Remote Branch: quic/master
      Local Patches: NONE
      Reconstruct Branch: NOTHING
  04-16 12:45:51.663 18832-18832/com.example.myapplication E/AndroidRuntime: FATAL EXCEPTION: main
      Process: com.example.myapplication, PID: 18832
      android.view.InflateException: Binary XML file line #8: Binary XML file line #8: Error inflating class com.google.android.material.slider.Slider
          at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
          at com.example.myapplication.firstPage.onCreateView(firstPage.java:16)
          at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2600)
          at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:881)
          at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238)
          at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1303)
          at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:439)
          at androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManagerImpl.java:2079)
          at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1869)
          at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1824)
          at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1727)
          at androidx.fragment.app.FragmentManagerImpl$2.run(FragmentManagerImpl.java:150)
          at android.os.Handler.handleCallback(Handler.java:739)
          at android.os.Handler.dispatchMessage(Handler.java:95)
          at android.os.Looper.loop(Looper.java:168)
          at android.app.ActivityThread.main(ActivityThread.java:5885)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687)
       Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class com.google.android.material.slider.Slider
          at android.view.LayoutInflater.createView(LayoutInflater.java:645)
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
          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 com.example.myapplication.firstPage.onCreateView(firstPage.java:16) 
          at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2600) 
          at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:881) 
          at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238) 
          at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1303) 
          at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:439) 
          at androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManagerImpl.java:2079) 
          at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1869) 
          at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1824) 
          at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1727) 
          at androidx.fragment.app.FragmentManagerImpl$2.run(FragmentManagerImpl.java:150) 
          at android.os.Handler.handleCallback(Handler.java:739) 
          at android.os.Handler.dispatchMessage(Handler.java:95) 
          at android.os.Looper.loop(Looper.java:168) 
          at android.app.ActivityThread.main(ActivityThread.java:5885) 
          at java.lang.reflect.Method.invoke(Native Method) 
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797) 
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687) 
       Caused by: java.lang.reflect.InvocationTargetException
          at java.lang.reflect.Constructor.newInstance(Native Method)
          at android.view.LayoutInflater.createView(LayoutInflater.java:619)
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764) 
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) 
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:835) 
          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 com.example.myapplication.firstPage.onCreateView(firstPage.java:16) 
          at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2600) 
          at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:881) 
          at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238) 
          at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1303) 
          at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:439) 
          at androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManagerImpl.java:2079) 
          at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1869) 
          at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1824) 
          at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1727) 
          at androidx.fragment.app.FragmentManagerImpl$2.run(FragmentManagerImpl.java:150) 
          at android.os.Handler.handleCallback(Handler.java:739) 
          at android.os.Handler.dispatchMessage(Handler.java:95) 
          at android.os.Looper.loop(Looper.java:168) 
          at android.app.ActivityThread.main(ActivityThread.java:5885) 
          at java.lang.reflect.Method.invoke(Native Method) 
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797) 
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687) 
       Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 11: TypedValue{t=0x2/d=0x7f0300b4 a=3}
          at android.content.res.TypedArray.getColorStateList(TypedArray.java:482)
          at com.google.android.material.resources.MaterialResources.getColorStateList(MaterialResources.java:71)
          at com.google.android.material.slider.Slider.processAttributes(Slider.java:365)
          at com.google.android.material.slider.Slider.&lt;init&gt;(Slider.java:261)
          at com.google.android.material.slider.Slider.&lt;init&gt;(Slider.java:252)
          at java.lang.reflect.Constructor.newInstance(Native Method) 
          at android.view.LayoutInflater.createView(LayoutInflater.java:619) 
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764) 
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) 
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:835) 
          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 com.example.myapplication.firstPage.onCreateView(firstPage.java:16) 
          at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2600) 
          at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:881) 
          at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238) 
          at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1303) 
          at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:439) 
          at androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManagerImpl.java:2079) 
          at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1869) 
          at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1824) 
          at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1727) 
          at androidx.fragment.app.FragmentManagerImpl$2.run(FragmentManagerImpl.java:150) 
          at android.os.Handler.handleCallback(Handler.java:739) 
          at android.os.Handler.dispatchMessage(Handler.java:95) 
          at android.os.Looper.loop(Looper.java:168) 
          at android.app.ActivityThread.main(ActivityThread.java:5885) 
          at java.lang.reflect.Method.invoke(Native Method) 
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797) 
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687) 
  04-16 12:45:53.565 18832-18832/com.example.myapplication D/Process: killProcess, pid=18832
  04-16 12:45:53.670 18832-18832/com.example.myapplication D/Process: com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException:113 java.lang.ThreadGroup.uncaughtException:693 java.lang.ThreadGroup.uncaughtException:690 
  </code></pre>
  <p>and in the following is the Build.gradle code:</p>
  <pre><code>plugins {
      id 'com.android.application'
  }
  
  android {
      compileSdkVersion 30
  
      defaultConfig {
          applicationId &quot;com.example.myapplication&quot;
          minSdkVersion 22
          targetSdkVersion 30
          versionCode 1
          versionName &quot;1.0&quot;
  
          testInstrumentationRunner &quot;androidx.test.runner.AndroidJUnitRunner&quot;
      }
  
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
          }
      }
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_8
          targetCompatibility JavaVersion.VERSION_1_8
      }
  }
  
  dependencies {
  
      implementation 'androidx.appcompat:appcompat:1.2.0'
      implementation 'com.google.android.material:material:1.2.0-alpha02'
  //    implementation 'com.google.android.material:material:1.3.0'
      implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
  //    implementation 'com.android.support:design:28.+'
  //    implementation 'com.google.android.material:material:1.3.0'
      testImplementation 'junit:junit:4.+'
      androidTestImplementation 'androidx.test.ext:junit:1.1.2'
      androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
  }
  </code></pre>
  <p>and if you want to ask me &quot;why don't you use the &quot;material:1.3.0&quot; version&quot;, I can say that because of rendering problem associated with Navigation Drawer Layout, according to some instruction in StackOverFlow, I changed it to &quot;material:1.2.0-alpha02&quot; and rendering problem was solved.
  I ask that question in another post. you can access that question in the following link:
  <a href="https://stackoverflow.com/questions/67095956/com-google-android-materialmaterial1-2-0-alpha02-does-not-include-some-instr">https://stackoverflow.com/questions/67095956/com-google-android-materialmaterial1-2-0-alpha02-does-not-include-some-instr</a></p>
  <p>and here is Theme.xml:</p>
  <pre><code>&lt;resources xmlns:tools=&quot;http://schemas.android.com/tools&quot;&gt;
  &lt;!-- Base application theme. --&gt;
  &lt;style name=&quot;Theme.MyApplication&quot; parent=&quot;Theme.MaterialComponents.DayNight.DarkActionBar&quot;&gt;
      &lt;!-- Primary brand color. --&gt;
      &lt;item name=&quot;colorPrimary&quot;&gt;@color/purple_200&lt;/item&gt;
      &lt;item name=&quot;colorPrimaryVariant&quot;&gt;@color/purple_700&lt;/item&gt;
      &lt;item name=&quot;colorOnPrimary&quot;&gt;@color/black&lt;/item&gt;
      &lt;!-- Secondary brand color. --&gt;
      &lt;item name=&quot;colorSecondary&quot;&gt;@color/teal_200&lt;/item&gt;
      &lt;item name=&quot;colorSecondaryVariant&quot;&gt;@color/teal_200&lt;/item&gt;
      &lt;item name=&quot;colorOnSecondary&quot;&gt;@color/black&lt;/item&gt;
      &lt;!-- Status bar color. --&gt;
      &lt;item name=&quot;android:statusBarColor&quot; tools:targetApi=&quot;l&quot;&gt;?attr/colorPrimaryVariant&lt;/item&gt;
      &lt;!-- Customize your theme here. --&gt;
  &lt;/style&gt;
  </code></pre>