'Stripe Android, Cannot resolve symbol 'PaymentConfiguration'

I'm trying to add a Payment Method in Stripe. In the client side (android) I'm adding the dependency implementation 'com.stripe:stripe-android:19.1.0'

The gradle version looks like

dependencies {
    ...
    classpath 'com.google.gms:google-services:4.3.3'
    classpath 'com.android.tools.build:gradle:4.0.2'
}

And my gradle app file version looks like

apply plugin: 'com.android.application'
android {
    compileSdkVersion 31
    defaultConfig {
        applicationId "com.buscaride.dev"
        minSdkVersion 21
        targetSdkVersion 31
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    dataBinding{
        enabled=true
    }
    compileOptions {
        targetCompatibility JavaVersion.VERSION_1_8
    }
}
dependencies {
    ...
    implementation 'androidx.appcompat:appcompat:1.4.0'
    ...
    implementation 'com.stripe:stripe-android:19.1.0'
}

So, when I try to import com.stripe.android.PaymentConfiguration; it says:

Cannot resolve symbol 'PaymentConfiguration'

No clue what I'm missing



Solution 1:[1]

Did you tried to invalidate Caches in "File Menu -> Invalidate Caches / Restart"?

Solution 2:[2]

Worked for me when I upgraded Android Studio to latest version.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Otourou Da Costa
Solution 2 Blaz Balon