title: Unable to load class AndroidComponentsExtension after upgrading the Android Gradle Plugin 7.1
body: <p>I recently downloaded <a href="https://developer.android.com/studio/releases#bumblebee" rel="noreferrer">Android Studio Bumblebee</a> and it helpfully asked whether I wanted to upgrade to Android Gradle Plugin 7.1.0, the version that shipped alongside Android Studio Bumblebee.</p>
  <p>After upgrading, I get a build error:</p>
  <pre><code>Unable to load class 'com.android.build.api.extension.AndroidComponentsExtension'.
  
  This is an unexpected error. Please file a bug containing the idea.log file.
  </code></pre>
  <p>And looking at the <code>idea.log</code> file, I see:</p>
  <pre><code>A problem occurred evaluating project ':main'.
      at org.gradle.initialization.exception.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:103)
      ...
  Caused by: org.gradle.api.GradleScriptException: A problem occurred evaluating project ':main'.
      at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:93)
      ...
  Caused by: java.lang.NoClassDefFoundError: com/android/build/api/extension/AndroidComponentsExtension
      at androidx.navigation.safeargs.gradle.SafeArgsPlugin.apply(SafeArgsPlugin.kt:73)
      at androidx.navigation.safeargs.gradle.SafeArgsPlugin.apply(SafeArgsPlugin.kt:42)
      ...
  Caused by: java.lang.ClassNotFoundException: com.android.build.api.extension.AndroidComponentsExtension
  </code></pre>
  <p>Which means I can't run my app and I need to downgrade the AGP 7.0 to get things working again. How do I fix this and upgrade to Android Gradle Plugin 7.1.0?</p>