Cannot see androidx core-ktx extensions in Android Studio project

It seems that my Android Studio is not recognizing the 'androidx.core:core-ktx:1.2.0' package. Android Studio version: 3.6.1

My gradle.properties:

android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official

My app module build.gradle:

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
   compileSdkVersion 29

   defaultConfig {
       applicationId "cz.nn.example.myapplication"
       minSdkVersion 25
       targetSdkVersion 29
       versionCode 1
       versionName "1.0"

       testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  }
  buildTypes {
      release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
      }
  }
  compileOptions {
    sourceCompatibility = JavaVersion.VERSION_1_8.toString()
    targetCompatibility = JavaVersion.VERSION_1_8.toString()
  }
  kotlinOptions {
    jvmTarget = "1.8"
  }
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.core:core-ktx:1.2.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
}

When I try to use extension functions like:

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        val manager = systemService<NotificationManager>()
        SharedPreferences.edit {

        }
    }
}

functions systemService<NotificationManager>() and edit are not recognized. What am I doing wrong?

%d bloggers like this: