title: Missing components in material google library on Android
body: <p>I am trying to use <code>SwitchMaterial</code> component within an Android project, however Android studio cannot find it at design time, and including it within my xml layouts causes a <code>ClassNotFoundException</code> at runtime. </p>
  
  <ul>
  <li>Recent Android studio project so is already setup using AndroidX</li>
  <li><code>'com.google.android.material:material:1.0.0'</code> is in my dependencies and gradle syncs with no errors</li>
  <li>Some other Material components are present, eg I am using <code>MaterialButton</code> on the same XML/Activity </li>
  <li>Unable to find <code>com.google.android.material.switchmaterial.SwitchMaterial</code> in xml</li>
  <li>Unable to import <code>com.google.android.material.switchmaterial.SwitchMaterial</code> when trying to add to activity java unit</li>
  <li>Build settings :  Compile SDK = 29 Build Tools = 29.0.2 Min SDK = 19 Target SDK = 29</li>
  <li>There are no proguard rules setup (At all) so should not be messing with it</li>
  <li>Spent an hour googling answers - nothing on SO, or the Android / Material Docs</li>
  </ul>
  
  <p><strong>Cannot find <code>SwitchMaterial</code> even though other components are there</strong>
  <img src="https://key.digital/stackoverflow/material-switch-missing.jpg" alt="Missing Components"></p>
  
  <p><strong>app build.gradle</strong></p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 29
      buildToolsVersion "29.0.2"
      defaultConfig {
          applicationId "my.app.id"
          minSdkVersion 19
          targetSdkVersion 29
          versionCode 1
          versionName "0.0.1"
      }
      buildTypes {
          release {
              minifyEnabled true
              proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
          }
      }
      dexOptions {
          javaMaxHeapSize "6g"
      }
      lintOptions {
          lintConfig file("lint.xml")
          showAll false
      }
  }
  
  dependencies {
      implementation fileTree(dir: 'libs', include: ['*.jar'])
      implementation 'androidx.appcompat:appcompat:1.1.0'
      implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
      implementation 'com.github.bumptech.glide:glide:4.10.0'
      implementation 'com.google.android.material:material:1.0.0'
      implementation 'com.google.code.gson:gson:2.8.6'
  }
  </code></pre>
  
  <p><strong>XML layout</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>
          &lt;com.google.android.material.switchmaterial.SwitchMaterial
              android:id="@+id/login_notificationsSwitchFamily"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginBottom="@dimen/margin_10"
              android:checked="true"
              android:text="Family Friendly"
              android:textSize="@dimen/textSize_16" /&gt;
  </code></pre>
  
  <p>Any help is appreciated. I cannot see why there would be missing components.</p>