title: Using Material Button gives ClassNotFound runtime error
body: <p>I am in the process of replacing the buttons in my app with Material Buttons using <code>&lt;com.google.android.material.button.MaterialButton</code> in the XML file and <code>private MaterialButton dateButton;</code> in the Java fragment file.
  I studied the Code Lab "<a href="https://codelabs.developers.google.com/codelabs/mdc-101-java/#5" rel="noreferrer">MDC-101 Android: Material Components (MDC) Basics (Java)</a>" to see how a Material Button is used. In the gradle.build (Module:app) file I added the dependencies like in the code lab.
  The code lab compiles and runs fine. My app compiles fine but gives an error when inflating the fragment layout:</p>
  
  <pre><code>E/AndroidRuntime: FATAL EXCEPTION: main
                Process: nl.kl_solutions.schedulecompareforzermelo, PID: 16708
                android.view.InflateException: Binary XML file line #26: Binary XML file line #26: Error inflating class com.google.android.material.button.MaterialButton
                Caused by: android.view.InflateException: Binary XML file line #26: Error inflating class com.google.android.material.button.MaterialButton
                Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.material.button.MaterialButton" on path: DexPathList[[zip file "/data/app/nl.kl_solutions.schedulecompareforzermelo-o6fuvqQPirym08EhaTRI6Q==/base.apk", zip file "/data/app/nl.kl_solutions.schedulecompareforzermelo-o6fuvqQPirym08EhaTRI6Q==/split_lib_dependencies_apk.apk", zip file "/data/app/nl.kl_solutions.schedulecompareforzermelo-o6fuvqQPirym08EhaTRI6Q==/split_lib_resources_apk.apk", zip file "/data/app/nl.kl_solutions.schedulecompareforzermelo-o6fuvqQPirym08EhaTRI6Q==/split_lib_slice_0_apk.apk", zip file "/data/app/nl.kl_solutions.schedulecompareforzermelo-o6fuvqQPirym08EhaTRI6Q==/split_lib_slice_1_apk.apk", zip file "/data/app/nl.kl_solutions.schedulecompareforzermelo-o6fuvqQPirym08EhaTRI6Q==/split_lib_slice_2_apk.apk", zip file "/data/app/nl.kl_solutions.schedulecompareforzermelo-o6fuvqQPirym08EhaTRI6Q==/split_lib_slice_3_apk.apk", zip file "/data/app/nl.kl_solutions.schedulecompareforzermelo-o6fuvqQPirym08EhaTRI6Q==/split_lib_slice_4_apk.apk", zip file "/data/app/nl.kl_solutions.schedulecompareforzermelo-o6fuvqQPirym08EhaTRI6Q==/split_lib_slice_5_apk.apk", zip file "/data/app/nl.kl_solutions.schedulecompareforzermelo-o6fuvqQPirym08EhaTRI6Q==/split_lib_slice_6_apk.apk", zip file "/data/app/nl.kl_solutions.schedulecompareforzermelo-o6fuvqQPirym08EhaTRI6Q==/split_lib_slice_7_apk.apk", zip file "/data/app/nl.kl_solutions.schedulecompareforzermelo-o6fuvqQPirym08EhaTRI6Q==/split_lib_slice_8_apk.apk", zip file "/data/app/nl.kl_solutions.schedulecompareforzermelo-o6fuvqQPirym08EhaTRI6Q==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/nl.kl_solutions.schedulecompareforzermelo-o6fuvqQPirym08EhaTRI6Q==/lib/x86_64, /system/lib64]]
                    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
  </code></pre>
  
  <p>This is a snippet from my layout file:</p>
  
  <pre><code>&lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal"
      android:background="@color/primaryLightColor"
      android:paddingLeft="@dimen/rasterleftpadding"
      android:paddingRight="@dimen/rasterrightpadding" &gt;
  
      &lt;Button
          android:id="@+id/btn_previous"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:layout_gravity="left"
          android:text="prev" /&gt;
  
      &lt;com.google.android.material.button.MaterialButton
          android:id="@+id/btn_week"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="center"
          android:layout_weight="1"
           /&gt;
  
      &lt;Button
          android:id="@+id/btn_next"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="right"
          android:layout_weight="1"
          android:text="next" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>And here is a snippet from the onCreateView:</p>
  
  <pre><code>@Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
                           Bundle savedInstanceState) {
      // Inflate the layout for this fragment
      View fragmentLayout = inflater.inflate(R.layout.fragment_week_schedule, container, false);
      //get references to the buttonBar buttons.
      leftButton = fragmentLayout.findViewById(R.id.btn_previous);
      rightButton = fragmentLayout.findViewById(R.id.btn_next);
      dateButton = fragmentLayout.findViewById(R.id.btn_week);
  </code></pre>
  
  <p>I only changed the datebutton to a Material Button which gives me the error. The app runs fine when using an ordinary Button for the dateButton.</p>
  
  <p>This is my gradle.build file:</p>
  
  <pre><code>dependencies {
  implementation fileTree(dir: 'libs', include: ['*.jar'])
  implementation "com.android.support:appcompat-v7:$rootProject.supportVersion"
  implementation "com.android.support:preference-v7:$rootProject.supportVersion"
  implementation "com.android.support:recyclerview-v7:$rootProject.supportVersion"
  implementation "com.android.support:cardview-v7:$rootProject.supportVersion"
  implementation "com.android.support.constraint:constraint-layout:1.1.3"
  implementation "com.android.support:design:$rootProject.supportVersion"
  implementation "com.android.support:support-v4:$rootProject.supportVersion"
  implementation 'com.google.code.gson:gson:2.8.5'
  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'
  
  //database components
  implementation "android.arch.persistence.room:runtime:$rootProject.roomVersion"
  annotationProcessor "android.arch.persistence.room:compiler:$rootProject.roomVersion"
  
  // Lifecycle components
  implementation "android.arch.lifecycle:extensions:$rootProject.archLifecycleVersion"
  annotationProcessor "android.arch.lifecycle:compiler:$rootProject.archLifecycleVersion"
  //QR library
  implementation 'me.dm7.barcodescanner:zxing:1.9.8'
  </code></pre>
  
  <p>where $rootProject.supportVersion is 28.0.0-beta01. I know that rc-01 and rc02 for some libraries are available but I ran the code lab with the beta01 dependencies so decided to keep this version to minimize changes.</p>
  
  <p>Anybody knows what is causing the runtime error?</p>