title: Cannot resolve class androidx.drawerlayout.widget.DrawerLayout or com.google.android.material.navigation.navigationview
body: <p>I have an app that works properly. Anyway, I have a &quot;strange&quot; behaviour of Android studio, in fact for the xml files it is not able to solve some classes, i.e. drawerLayout, constraintLayout, CircleImage etc. (see the image below)</p>
  <p><a href="https://i.stack.imgur.com/i0m7p.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/i0m7p.png" alt="Android Studio Screenshot" /></a></p>
  <p>Before opening android studio I have a warning about adding project dependencies:</p>
  <p>Problem: Inconsistencies in the existing project dependencies found.
  Version incompatibility between:</p>
  <ul>
  <li>androidx.navigation:navigation-ui:2.5.1@aar and:</li>
  <li>androidx.appcompat:appcompat:1.5.0@aar</li>
  </ul>
  <p>With the dependency:</p>
  <ul>
  <li>androidx.annotation:*1.1.0</li>
  <li>androidx.annotation:*.2.0.0</li>
  </ul>
  <p>What I tried:</p>
  <ul>
  <li>invalidating caches and restarting app</li>
  <li>update my gradle file, as shown below:</li>
  </ul>
  <pre><code>plugins {
      id 'com.android.application'
      id 'com.google.gms.google-services'
      id 'androidx.navigation.safeargs'
  }
  apply plugin: &quot;androidx.navigation.safeargs&quot;
  
  sourceSets {
      main {
          java {
          }
      }
  }
  
  android {
      compileSdk 32
  
      defaultConfig {
          applicationId &quot;com.example.frangela&quot;
          minSdk 21
          targetSdk 31
          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
      }
      buildFeatures {
          viewBinding true
      }
  
  }
  
  dependencies {
  
      implementation 'de.hdodenhof:circleimageview:3.1.0'
      implementation 'androidx.appcompat:appcompat:1.5.0'
      implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
      implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.5.1'
      implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'
      implementation &quot;androidx.navigation:navigation-fragment:2.5.1&quot;
      implementation &quot;androidx.navigation:navigation-ui:2.5.1&quot;
      implementation 'androidx.cardview:cardview:1.0.0'
      implementation 'com.google.firebase:firebase-database:20.0.5'
      implementation 'com.google.firebase:firebase-common-ktx:20.1.1'
      implementation 'com.google.android.gms:play-services-maps:18.1.0'
      implementation 'com.google.android.gms:play-services-location:20.0.0'
      implementation 'com.google.firebase:firebase-crashlytics-buildtools:2.9.1'
      implementation platform('com.google.firebase:firebase-bom:30.3.1')
      implementation 'com.google.firebase:firebase-functions'
      implementation &quot;androidx.recyclerview:recyclerview:1.2.1&quot;
      implementation 'com.firebaseui:firebase-ui-database:8.0.1'
      implementation 'com.google.firebase:firebase-auth'
      implementation 'com.google.android.gms:play-services-auth:20.2.0'
      implementation 'com.squareup.picasso:picasso:2.8'
      implementation 'com.google.firebase:firebase-messaging'
      implementation &quot;androidx.constraintlayout:constraintlayout:2.1.4&quot;
      implementation &quot;androidx.constraintlayout:constraintlayout-compose:1.0.1&quot;
  }
  
  </code></pre>
  <p>My gradle Module:</p>
  <pre><code>buildscript {
      repositories {
          google()
          mavenCentral()
          maven { url 'https://repo1.maven.org/maven2' }
      }
      dependencies {
          def nav_version = &quot;2.5.1&quot;
          classpath &quot;androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version&quot;
          classpath 'com.android.tools.build:gradle:7.2.2'
          classpath 'com.google.gms:google-services:4.3.13'
  
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
      }
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  </code></pre>
  <p>I think that there could be problems with the dependencies, but for example I cannot find any of that regarding annotation in my gradle file.
  Thank you in advance for anyone that could help me.</p>