title: Cannot access 'kotlinx.coroutines.CoroutineScope' which is a supertype of 'androidx.lifecycle.LifecycleCoroutineScope'
body: <p>Tried to use room api and had to deal with asynchronous tasks you know why.
  I chose kotlin coroutines and androidx.lifecycle. Tried to write some code and got 2 errors displaying in IDE</p>
  <p>Cannot access 'kotlinx.coroutines.CoroutineScope' which is a supertype of 'androidx.lifecycle.LifecycleCoroutineScope'. Check your module classpath for missing or conflicting dependencies
  Cannot access class 'kotlinx.coroutines.Job'. Check your module classpath for missing or conflicting dependencies
  <a href="https://i.stack.imgur.com/7QpXH.png" rel="noreferrer">error</a></p>
  <p>Here is my gradle module</p>
  <pre><code>plugins {
      id 'com.android.application'
      id 'kotlin-android'
      id 'kotlin-kapt'
  
  }
  
  android {
      compileSdk 31
  
      defaultConfig {
          applicationId &quot;com.jacksafblaze.sqlitedemo&quot;
          minSdk 21
          targetSdk 31
          versionCode 1
          versionName &quot;1.0&quot;
  
          testInstrumentationRunner &quot;androidx.test.runner.AndroidJUnitRunner&quot;
      }
      buildFeatures{
          viewBinding true
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
          }
      }
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_8
          targetCompatibility JavaVersion.VERSION_1_8
      }
      kotlinOptions {
          jvmTarget = '1.8'
      }
  }
  
  dependencies {
      implementation &quot;androidx.room:room-ktx:2.3.0&quot;
      implementation &quot;androidx.room:room-runtime:2.3.0&quot;
      kapt &quot;androidx.room:room-compiler:2.3.0&quot;
      implementation &quot;androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0&quot;
      implementation &quot;androidx.lifecycle:lifecycle-runtime-ktx:2.4.0&quot;
      implementation'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0'
      implementation'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0'
      implementation 'androidx.core:core-ktx:1.7.0'
      implementation 'androidx.appcompat:appcompat:1.4.0'
      implementation 'com.google.android.material:material:1.4.0'
      implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
      implementation 'androidx.legacy:legacy-support-v4:1.0.0'
      testImplementation 'junit:junit:5'
      androidTestImplementation 'androidx.test.ext:junit:1.1.3'
      androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
  }
  </code></pre>
  <p>and gradle project</p>
  <pre><code>buildscript {
      repositories {
          google()
          mavenCentral()
      }
      dependencies {
          classpath &quot;com.android.tools.build:gradle:7.0.3&quot;
          classpath &quot;org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.0&quot;
  
          // 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 tried to invalidate caches and restart, to recreate app from scratch, and to reinstall android studio and I am still getting this error.</p>